eachParent()
iterates through all the parent items (the immediate parent and its parent, etc until the parent is the component itself)
eachParent(id: string | number, callback: function, self?: boolean): void;
Parameters:
id: string | number
- the ID of the itemcallback: function
- the function that will be applied to each parent of the item. The function takes three parameters:item: object
- required, the object of an itemindex: number
- optional, the index of an itemarray: object[]
- optional, an array with items
self: boolean
- optional, defines whether the function should iterate over the specified item itself; false by default
Example
toolbar.data.eachParent("new_btn", item => console.log(item));