Skip to main content

mapVisible()

iterates through all visible items

mapVisible(callback: function, id?: string | number, direct?: boolean): any;

Parameters:

  • callback: function - the function that will be applied to every visible item. The function can take three parameters:
    • item: object - required, the object of an item
    • index: number - the index of an item
    • array: object[] - an array with items
  • id?: string | number - optional, the ID of a control the child items of which will be included
  • direct?: boolean - optional, defines whether only direct children of the control will be included in the iteration

Example

treegrid.data.mapVisible(item => console.log(item), "parent_id", true);
note

The method is used in TreeGridCollection only.

note

The method iterates through the visible items, i.e through the items that are not hidden or collapsed.

Change log:

added in v7.2