add
adds a new item to the tree
string add(object obj, [number index,string parentId] );
| obj | object | the item object |
| index | number | optional, the position that the item will be added to (zero-based numbering) |
| parentId | string | optional, the parent id |
| string | ID 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
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.