eachSubItem

iterates through all childs (of any level) of the specified branch

void eachSubItem(string pid,function code);

Parameters

pidstringthe parent (branch) id
codefunctiona function that needs calling for each data item

Example

tree.data.eachSubItem("2", function(obj){ console.log(obj.id); });

Details

Note,

  • eachSubItem iterates through all child nodes of the branch (without the specified parent node).
  • The eachSubItem's function takes the data object as a parameter.
  • If you want to iterate only through the first-level childs of a branch - use the eachChild method.
See also
Back to top