lobo
#1
i have table with multiple trees inside. i need to render_sql method to print one of them. root nodes have different id, not 0.
my php:
$treeConn->render_sql("SELECT id,nazwa,parent_id FROM bp_wezel WHERE widok_id = 1", "id", "", "parent_id");
log:
SELECT id,nazwa,parent_id FROM bp_wezel WHERE widok_id = 1 AND = '0'
root nodes have different id, not 0
You should pass the id of the root node to the server with loadXML method
tree.loadXML(url+"?id=someId");
lobo
#3
i tried to put xml into String:
this one is working:
tree.loadXMLString("<tree id='0'><item id='694' text='CDN' child='-1' ><item id='696' text='test' child='-1' ><item id='697' text='test2' child='-1' ></item></item></item></tree>");
and this one not:
tree.loadXMLString("<tree id='694'><item id='696' text='test' child='-1' ><item id='697' text='test2' child='-1' ></item></item></tree>");
these xmls was generated by connector, first one without parameters and with extra node with id=0 in db and second with ?id=694 without extra node
Make sure that the 4th parameter of tree constructor is 694 - the id of root item:
tree=new dhtmlXTreeObject(“treeboxbox_tree”,“100%”,“100%”,694);