Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by otter on Jan 28, 2009 01:15
open dhtmlx forum
smartrefreshitem sort

The sorting is not correkt after smartrefreshitem.
Example:
A tree like
-a
-b
-c
I change the name of b in d and use smartrefreshitem
Now the tree looks like
-a
-d
-c
and not like
-a
-c
-d
The xml ist in correkt order.
What can i do?
Answer posted by Support on Jan 28, 2009 01:46
The sorting is one time operation, the grid will not preserve it if data will be changed by any API call
If you need to preserver sorting, you may just call grid.sortRows to update order after data updated from XML
Answer posted by otter on Jan 28, 2009 01:54
This is a tree not a grid.
I have to sort the tree not only alphabetically, so i need the sort order of the xml file (loaded correct)

otetr

Answer posted by Support on Jan 28, 2009 03:17
The same is actual for tree as well. Sorting order is not preserved during smart-refresh operation. 
smart refresh 
 - change text of items where it necessary
 - remove items which not exists in XML
 - add new items to the end of branch

If you need update from XML and maintain order defined in XML you need to use refreshItem method, which fully reload the branch.