Hi there,
I observe that dhtmlXTree.deleteItem() automatically opens the editor for the parent node if the parentnode is currently selected and the selectParent=true parameter is passed. To me, this appears to be inconsistent with documentation.
Please observe the following tree structure
ID=1 My mail items
|
ID=2 (-)--Inbox
| |
ID=3 | |---Subfolder 1
| |
ID=4 | |---Subfolder 2
|
ID=5 |---Deleted items
I create this tree using the following code:
var _dhtmlxTree = new dhtmlXTreeObject("tree", "100%", "100%", 0);
_dhtmlxTree.setImagePath("../dhtmlx/codebase/imgs/");
_dhtmlxTree.enableTreeLines();
_dhtmlxTree.enableItemEditor(true);
_dhtmlxTree.setXMLAutoLoading("../api/1.0/document_load.php?Format=dhtmlxGrid-BrowserFolders");
_dhtmlxTree.enableTreeLines(true);
_dhtmlxTree.loadXML("../api/1.0/document_load.php?Format=dhtmlxGrid-BrowserFolders&id=0");
// Click on Inbox now
window.setTimeout(function()
{
_dhtmlxTree.deleteItem(3, true);
}, 2000);
Two seconds after starting the script we simulate a user initating a delete action. we deleteItem(3, true) which, according to the documentation should delete Subfolder 1 and select Inbox. Subfolder is indeed deleted and Inbox is indeed selected.
However…
If before calling deleteItem() we manually click on Inbox to place it in a selected state, then deleteItem() will not only select Inbox, but also place it in an edit mode.
Is this normal behaviour? My impression is that selecting an item is substantially different from initiating an edit mode and merely passing a parameter that instructs Dhtmlx to select the parent item should - IMHO - not commence an edit mode.
Can anybody comment on this? It this behaviour by design, or should we consider this to be a bug?
Regards,
Joost