Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Denny on May 20, 2009 02:24
open dhtmlx forum
Sorting and filters

I have several filters which can be activated by clicking buttons outside the grid. When I sort the grid's rows and switch between filters, sorting gets lost and returns to the initial sorting order. How to remain sorting order through filtering?
Answer posted by Support on May 20, 2009 03:52
Sorting applied in filtered state will be lost after unfiltering of grid.The only way to prevent changes is to save sorting state before filtering and reapply it after filter applied


var state = grid.getSortingState(); //get sorting state
grid.filterBy(....
grid.sortRows(state[0],null,state[1]); //restore sorting