简体   繁体   English

UI网格设置列顺序

[英]UI-grid set column order

I am trying to set the initial column order for ui-grid from data that I am getting from an $http call. 我正在尝试从$ http调用中获取的数据设置ui-grid的初始列顺序。 When configuring gridOptions.colDefs it does not appear that any properties exist for me to set with initial order. 在配置gridOptions.colDefs时,似乎没有任何属性可供我使用初始顺序进行设置。 How do I go about setting the initial column order for the grid? 如何设置网格的初始列顺序?

I also noticed that there is a gridColumn class within the ui.grid module which allows for the order to be set. 我还注意到ui.grid模块中有一个gridColumn类,它允许设置顺序。 If this is the case I am unclear how to set this class in the grid and the documentation is not very clear and lacks examples. 如果是这种情况,我不清楚如何在网格中设置此类,文档不是很清楚,缺乏示例。

Column order can be set simply by the order in which the columns appear in the columnDefs array. 列顺序可以简单地按列在columnDefs数组中出现的顺序设置。 If you are getting your columns from an $http call just setup the columnDefs array based on that and it should work. 如果你从$ http调用中获取列,只需根据它设置columnDefs数组,它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM