@helix-x/datagrid-ui - v0.1.2
    Preparing search index...

    Function useSelectionModel

    • Multi-row selection with shift-range support.

      Selection survives paging: ids stay selected even when their rows are not loaded, which is why getSelectedRows returns only the loaded subset while selectedIds holds everything.

      Type Parameters

      • T

        The row type.

      Parameters

      • rows: T[]

        The currently loaded page.

      • getRowId: (row: T) => RowId

        Stable identity for a row.

      • OptionalonSelectionChanged: (ids: RowId[]) => void

        Called with every selected id after each change.

      Returns UseSelectionModelResult<T>

      The selection state and its mutators.