I am using a custom excell type (date2). I have overridden the getValue() method and defined a custom sort method (date2_custom) for this type. The sorting works correctly when the header is clicked.
That’s correct. I save the sorting state when the user sorts with header. I’m just trying to apply the sort using code when fresh data is loaded into the grid. Cheers
PS there is definitely data in the array when I call the sortRows method.
when fresh data is loaded into the grid
Timing of call is important here. When data is loaded in grid, in some cases it can reset current state and configuration ( when xml contains HEAD section for example ), in such case information about previous sorting will be lost.
The safe way is the next
var state = grid.getSortingState();
grid.load(url, function(){
grid.sort(state[0]);
});
Above code stores state before loading and call sort after loading.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan