Reputation: 637
I am trying to set the initial column order for ui-grid from data that I am getting from an $http call. When configuring gridOptions.colDefs it does not appear that any properties exist for me to set with initial order. 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. 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.
Upvotes: 1
Views: 2802
Reputation: 1690
Column order can be set simply by the order in which the columns appear in the columnDefs array. If you are getting your columns from an $http call just setup the columnDefs array based on that and it should work.
Upvotes: 3