uiGrid switch rows and columns

霸气de小男生 提交于 2019-12-10 18:28:11

问题


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.

Is this possible with ui grid?


回答1:


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........ :)



来源:https://stackoverflow.com/questions/31816875/uigrid-switch-rows-and-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!