Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AG-GRID Default Sort Model with Dynamic Column Defs

So I have a Grid setup that works with the Enterprise Row Model. The columns are very dynamic and so the column defs are not known until the first query for rows is made to the server. This all works fine, but how can I set a default sort state when the column defs are not set until after the request has succeeded?

like image 886
Alan Dragicevich Avatar asked Mar 09 '23 08:03

Alan Dragicevich


1 Answers

Once the grid has been set-up with the column defs you can just set the sort on any column

gridOptions.columnApi.getColumn(COLUMN_NAME).setSort("asc")
like image 167
Jonathan Naim Avatar answered Mar 15 '23 18:03

Jonathan Naim