Check documentation for the latest version 6.0 of dhtmlxSuite insertNewItem DHTMLX Docs

insertNewItem

creates a new node as a child to the specified one with parentId

void insertNewItem(string|number parentId,string|number id,string text, [function actionHandler,string image1,string image2,string image3,string optionStr,mixed children] );

Parameters

parentIdstring|numberparent node's id
idstring|numbernew node's id
textstringnew node's label
actionHandlerfunctionfunction fired on clicking an item, optional
image1stringimage for a node without children, optional
image2stringimage for a closed node, optional
image3stringimage for an opened node, optional
optionStrstringoptions' string, optional
childrenmixednode children flag (for dynamic trees), optional

Example

myTree.insertNewItem("my_parent_11","11_1","item 11");

Back to top