Skip to main content

eachParent()

iterates through all the parent items (the immediate parent and its parent, etc until the parent is the component itself)

eachParent(id: Id, callback: DataCallback<T>, self?: boolean): void;

Parameters:

  • id: string - the ID of the item
  • callback: function - the function that will be applied to each parent of the item
  • 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));