View Full Version : [CLOSED] How to set grid store sort?

Apr 04, 2013, 9:13 PM
How can I set the store's sort on the serverside without actually sorting the grid? The below code will cause the grid to reload data:


What I want is just tell the store that hey, I gave you new data that's already sorted on these columns so just visually remember the sorters but dont request new data.

Apr 05, 2013, 1:06 AM

If I did understand you correctly you just need to update UI without real sorting. In this case you should use setSortState: http://docs.sencha.com/ext-js/4-2/#!/api/Ext.grid.column.Column-method-setSortState .

App.GridPanel1.headerCt.items.items[0].setSortState('DESC', true, true)

To use it from ServerSide you should use X.AddScript();

Apr 05, 2013, 1:18 AM
It's more than just UI since the next reload should persist the sort too. I ended setting the grid's sorters property using X.AddScript