Type alias GetRowIdFn<T>

GetRowIdFn<T>: ((row, rowIndex?) => string | number)

Type Parameters

  • T

Type declaration

    • (row, rowIndex?): string | number
    • Returns a unique, stable id for a row – used to remember expanded tree nodes, checked and selected rows and the first visible row (AutoRestoreOptionsIf, TableStateIf).

      Tree tables get the object of the node (treeRow.data). Models without row objects (e.g. an own AreaModel that computes its values) get undefined and the displayed row index – declare the second parameter to support them: (_row, rowIndex) => rowIndex.

      Parameters

      • row: T
      • Optional rowIndex: number

      Returns string | number

      Example

      const getRowId: GetRowIdFn<Order> = (order: Order) => order.id;
      

      Typeparam

      T - The type of the rows.