Tree nodes is closed when updated

I made a function to update the tree node content but every time I call it, tree nodes are closed. How can I do to keep opened the tree during update?

This is the function:

    function makeTree (){

var treeArray = new Array();

tree_1.deleteChildItems(0);
treeArray=geometryToArray();
console.log(treeArray);
tree_1.loadJSArray(treeArray);
}

Hello
Please, provide us completed demo on support@dhtmlx.com with a link to this topic
docs.dhtmlx.com/auxiliary_docs__ … pport.html