Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nishan Naseer on Jun 01, 2009 19:40
open dhtmlx forum
Grid: enable sorting after init ?

Hi,

Is there a way to enable sorting after init() ?

I am dynamically loading xml, and want to enable sorting only after all rows have been loaded.
I tried handling onBeforeSorting event and returning true/false from it based on whether data is fully loaded or not, dint work.

Any pointers ?

Thanks in advance,
Nishan
Answer posted on Jun 02, 2009 01:51
You can use onXLE event or second parameter on load method to catch the moment, when data loaded and ready to be sorted

grid.load(url,function(){
        grid.sortRows(1,"str","asc");
});