Documentation

add

adds a new item to the tree

string add(object obj,number index,string pid);

Parameters

objobjectthe item object
indexnumberthe position that the item will be added to (zero-based numbering)
pidstringthe parent id

Returns

stringthe item id

Example

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

Back to top