Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 23, 2009 13:43
open dhtmlx forum
how to set sorting tree initially, on tree load? ...

how to set sorting tree initially, on tree load?
Answer posted by Alex (support) on Mar 24, 2009 04:52

You can try to use following:

tree.loadXML("some.xml",function(){

tree.sortTree(...);

})

The second parameter is function which is called after xml loading

Answer posted on Mar 24, 2009 06:53

May I use following:

myTreeGrid.attachEvent("onXLE",function(a,b){ 
        myTreeGrid.sortTreeRows(0,"str","asc");
   });

Answer posted by Alex (support) on Mar 24, 2009 08:11

Yes, you can this method for treegrid or 

myTreeGrid.loadXML(path_to_xml,function(){ 
myTreeGrid.sortTreeRows(0,"str","asc");

});