Hi,
I am using dhtmlx tree v2.0 with dataprocessor to insert tree in database. But while creating the tree after loading the web page, I cannot add a single initial node by using the functions. I get no error. This is the following part of code for adding/deleting I am trying:
<a href="#" onclick=“var d=new Date(); tree.insertNewItem(tree.getSelectedItemId() || 0,d.valueOf(), ‘New Item’);>Add node as child of selected (or top)
<a href=”#" onclick=“var d=new Date(); tree.insertNewNext(tree.getSelectedItemId(), d.valueOf(), ‘New Item’);>Add node next to selected
Delete selected row
I have created the database table from sampleDB file. I even get valid xml data from get.php. Your help will be greatly appreciated. Thanks a lot.
You have a typo in link code
<a href="#" onclick=“var d=new Date(); tree.insertNewItem(tree.getSelectedItemId() || 0,d.valueOf(), ‘New Item’);”>Add node as child of selected (or top)
the closing quote was missed, and as result link was non-functional
oops! sorry i actually did put the closing but forgot to put it here.Thanks for ur quick reply. Anyways I got something to work but partially. Here is my new code:
tree.insertNewItem(tree.getSelectedItemId() || 0,d.valueOf(), ‘New Item’,0,0,0,0,‘SELECT’)
var tree=new dhtmlXTreeObject(“treeboxbox_tree”,“100%”,“100%”,0);
tree.setImagePath("…/…/codebase/imgs/csh_winstyle/");
tree.enableDragAndDrop(true);
tree.enableItemEditor(true);
tree.loadXML(“php/get.php”);
myDataProcessor = new dataProcessor(“php/update.php”);
myDataProcessor.enableDebug(true);
myDataProcessor.init(tree);
tree.init();
By this code when I add a node it inserts into database with a message but shows nothing on the web page. When I remove enableDebug(true) it does nothing.
Now when I place tree.init() before the loadXML function I can add nodes but does not insert anything into the database. I dont think there is any syntax error as I keep checking the error console of browser too. A help here would be great here now. Thanks.
tree.init();
dhtmlxtree doesn’t support such method as init , it is initialized automatically and need not any special command for it.
>>By this code when I add a node it inserts into database with a message but shows nothing on the web page. When I remove enableDebug(true) it does nothing.
Exactly the same code works correctly in local sample.
Please check working sample, which was sent by email.
If issue still occurs for you - please provide exact HTML page where issue can be reconstructed ( you can send it directly to support@dhtmlx.com )