eachChild
iterates through the first-level children of the specified branch
void eachChild(string pid,function code, [object master,boolean all] );
| pid | string | the parent (branch) id |
| code | function | a function that needs calling for each data item |
| master | object | an object that the function is applied to (this by default) |
| all | boolean | if 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 that
- 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 children of a branch - use the eachSubItem method.
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.