Sort only the parents , not also the children in a tree

how could I sort only the parents , not also the children in a tree


In case of dhtmlxtree it is can be controlled by third parameter of sortTree method, just set it as false
tree.sortTree(0,“asc”,false);



In case of treeGrid - it can’t be controlled. The component will sort all levels.