uiGrid 切换行列 [英] uiGrid switch rows and columns

查看:25
本文介绍了uiGrid 切换行列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个关于 ui 网格可能性的一般性问题.到目前为止,我在 ui grid 方面取得了巨大的成功.现在我有一个用例,我想切换网格的行和列.

This is a bit of a general question into the possibilities of ui grid. I have had tremendous success with ui grid thus far. Now I have a use case where I want to switch the rows and columns of the grid.

基本上,我希望标题在第一列中垂直"显示,并使行成为列.

Basically, I would like the headers to be displayed 'vertically' in the first column and to have the rows become columns.

这可以用 ui grid 实现吗?

Is this possible with ui grid?

推荐答案

据我所知 UI-grid 不支持这个.我怀疑你是否能做到这一点.可以尝试动态构建 ColumnsDef 和 Data 并将其传递给 gridOptions.或者添加额外的列,这应该是您将传递所有标题值的第一列.将单元格的背景更改为类似于标题单元格.现在添加第二列,在其中传递整个第一行值.完全隐藏原始标题行.现在看看你得到了你需要的网格...... :)

As far as i know UI-grid doesn't support this. I doubt if you can do that. May be try building ColumnsDef and Data dynamically and pass it to gridOptions. Or else add extra column and this should be the first column where you will pass all the header values. Change the background of the cells to look like header cells. Now add second column where you pass the entire first row values. Hide the original header row completely. see now u got your required grid........ :)

这篇关于uiGrid 切换行列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆