add

adds a new item to the tree

string add(object obj, [number index,string parentId] );
objobjectthe item object
indexnumberoptional, the position that the item will be added to (zero-based numbering)
parentIdstringoptional, the parent id
stringID of the newly added item

Example

//inserts a new item into the branch with id='root'
tree.data.add({id:"item10", value:"NewItem"}, 0, "root" );

Related samples

See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript framework and page of javascript tree view product.