w2grid.sortData

Array of sort objects (submitted to data source for record sorting).
Array, default = []
If user clicks on the column (or holds shift key and clicks several columns) and if the column is sortable, the grid will generate sort objects and submit it to the data source to apply sorting.
As a developer you can define initial sorting during object creation. You can also change sorting form JavaScript during run-time by changing this array. Do not forget to call .refresh method to refresh them on the screen. If you data source is local the grid will sort the records using this .sortData array. If the data source is remote, the gird will submit .sortData array to the server for sorting.
The structure of the sort object is: If user clicks the same column second time the sort direction will be reversed. If you want to make a column unsortable, set .sortable property of the column object to false.

User Comments

comments powered by Disqus