I’m loading a tree from external URL, it works fine on first load, but when I call this a second time to load new responseObj.response, it does not refresh the tree. if I add course_list.refreshItems(0); - after the loadxmlstring then the tree is simply blanked out.
course_list = new dhtmlXTreeObject(“courseboxbox_tree”, “100%”, “100%”, 0);
course_list.setSkin(‘dhx_skyblue’);
course_list.enableCheckBoxes(1);
course_list.setImagePath(“dhtmlxTree/codebase/imgs/csh_bluebooks/”);
course_list.deleteChildItems(0);
alert(nitobi.xml.serialize(responseObj.response));
course_list.loadXMLString( nitobi.xml.serialize(responseObj.response) );
I simply want to load the new xml string into the tree.
Thanks,
Brendan
Before loading from XML new tree, you need to clear the previous one.
tree.deleteChildItems(0);
tree.loadXMLString( nitobi.xml.serialize(responseObj.response) );
I am doing that… and it still does not work.
course_list.deleteChildItems(0);
alert(nitobi.xml.serialize(responseObj.response));
course_list.loadXMLString( nitobi.xml.serialize(responseObj.response) );
Please check that nitobi.xml.serialize(responseObj.response) returns the desired xml structure.
The xml format of dhtmlx components is presented here dhtmlx.com/docs/products/doc … index.html
I have checked and the code is defintely correct… See attached for what I get when I click on a node the first time. After that any other node selected produces the xml. I know because I added a alert(xml) which shows the correct xml. See the attached. I select a node it shows the checkbox tree to the right correctly. I then select Forex and the xml is correct it does not updated the tree. I’ve tried all the given suggestions.
The problem wasn’t reproduced locally.
Could you please provide the complete demo to recreate the issue (with xml string that you try to load instead of nitobi.xml.serialize(responseObj.response))
Even when I hard code the XML file and use loadXML it does not reload the tree.
First XML
PHP 101
3
Coldfusion Development 101
7
Second XML
PHP 101
3
Coldfusion Development 101
7
Please check here : demo.inventivetec.com/inventivex … ntid=10021
You will see that alert box with the correct XML.
Thanks,
Brendan
Hello
there isn’t a demo by this link. Please check the page. Moreover you can send the sample to support@dhtmlx.com
Hi Alex,
Did you recieve my email… I am desperate to get this resolve as soon as possible.
Thanks,
Brendan
Hello
yes we did. The answer will be sent by email.
I am also facing a similar problem …please help…thanks in advance
Please provide the code snippet that reloads tree. The correct one is like here:
function reload(){
tree.deleteChildItems(0);
tree.loadXML(url);
}