eachChild

iterates through the first-level childs of the specified branch

void eachChild(string pid,function code, [object master,boolean all] );

Parameters

pidstringthe parent (branch) id
codefunctiona function that needs calling for each data item
masterobjectan object that the function is applied to (this by default)
allbooleanif true, hidden (as well as hidden by filtering) items are iterated

Example

tree.data.eachChild("1.2",function(obj){ console.log(obj.id)});

Details

Note,

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