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

    Interface UseColumnStateResult<T, C>

    What useColumnState returns.

    interface UseColumnStateResult<T, C> {
        allColumns: ResolvedColumn<T, C>[];
        isHidden: (colId: string) => boolean;
        layout: ColumnLayout<T, C>;
        moveColumn: (colId: string, toIndex: number) => void;
        reset: () => void;
        setHidden: (colId: string, hidden: boolean) => void;
        setPinned: (colId: string, pinned: Pinned | undefined) => void;
        setWidth: (colId: string, width: number) => void;
        state: ColumnStateValue;
        visibleColumns: ResolvedColumn<T, C>[];
    }

    Type Parameters

    • T

      The row type.

    • C

      The context type.

    Index
    allColumns: ResolvedColumn<T, C>[]

    Every column, in user order, including hidden ones (for the columns panel).

    isHidden: (colId: string) => boolean

    Whether a column is hidden.

    layout: ColumnLayout<T, C>

    Measured geometry for the visible columns.

    moveColumn: (colId: string, toIndex: number) => void

    Move a column to a new index in the display order.

    reset: () => void

    Discard the user's layout and return to the column definitions' defaults.

    setHidden: (colId: string, hidden: boolean) => void

    Show or hide one column.

    setPinned: (colId: string, pinned: Pinned | undefined) => void

    Pin one column to an edge, or pass undefined to unpin it.

    setWidth: (colId: string, width: number) => void

    Resize one column. Clamped to its minWidth and maxWidth.

    The raw layout state, ready to persist.

    visibleColumns: ResolvedColumn<T, C>[]

    Just the visible columns, in display order.