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?

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

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

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.