Tree sublevels not ordered

Hello, I’m new here but not new using the forum answers.

I need help with this problem.
I have a Tree inside a page.
The Tree’ folders from root level came ordered, but the sublevel’ folders came disordered.

Here is the example:

Hope you can help me.

Hello
Try the next simple sample:

tree = new dhtmlXTreeObject("treeboxbox_tree2", "100%", "100%", 0); tree.setSkin('dhx_skyblue'); tree.setImagePath("../dhtmlxTree_prof/codebase/imgs/csh_bluebooks/"); tree.setDataMode("json"); tree.loadJSONObject({ id:'0', item:[ {id: '000_1', text: 'Item 1-0', item:[ {id: '0-1', text: 'testP'}, {id: '0-1-0', text: '01.test'}, {id: '0-2-0', text: '10.test'}, {id: '0-3-0', text: '02.test'} ]} ]}, function(){ tree.sortTree("0", "ASC", true) });
Locally it works fine

Hello Darya.
Thank you for the reply.

I don’t think that will work in my case, I need all the sublevels be ordered, not only in this case, actually that’s dev server, I don’t know what will appear in prod server.
What I mean is that I need a global solution, not only to order that sublevels that I show you.

Thank you, I hope there is a answer to my problem.

I meant you need the next:

tree.loadXML(xml, function(){ tree.sortTree("0", "ASC", true) });
In doesn’t depend on the way of loading tree. You just need to use load aftercall with this method.