each of TreeStore, Methods Webix Docs
objectan object that the function is applied to (this by default) all
booleanif true, hidden (as well as hidden by filtering) items are iterated pidstringthe parent node id. Used to iterate through a specific branch
Example
//iterates through all items of the tree
tree.data.each(
function(obj){
console.log(obj.value)
}
);
//iterates through items with $parent="1.2"
tree.data.each(
function(obj){
console.log(obj.value)
}, this, true, "1.2");
Details
Note that
- each iterates through both parent and child nodes.
- The each's function takes the data item object as a parameter.
- If you specify the 3rd parameter (pid), each will iterate only through child nodes of the branch (without iterating through the specified parent node).
See also
Back to top