g3-toolkit API Reference
    Preparing search index...

    Interface DataGridColumn<T>

    A column for the rows path (#39): how to read a value out of a row, optionally how to render it, and which inline filter the header carries.

    interface DataGridColumn<T> {
        align?: "num";
        csv?: (row: T) => string;
        filter?: "values" | "range" | "none" | "text";
        header: string;
        hidden?: boolean;
        id: string;
        render?: (value: unknown, row: T) => ReactNode;
        title?: string;
        value: (row: T) => unknown;
        width?: string | number;
    }

    Type Parameters

    • T
    Index

    Properties

    align?: "num"

    "num" right-aligns the header and cells and uses tabular figures (#58). Default left.

    csv?: (row: T) => string

    CSV value (#58): what the export writes for this column instead of the cell value, so a cell that renders a local name can export the full IRI. Quoted per RFC 4180 as needed.

    filter?: "values" | "range" | "none" | "text"

    Inline header filter kind. "text" is a substring match, "values" a checklist over the distinct values with counts (#47: several at once, exact match on the value's string form), "range" a numeric min/max pair, "none" no filter (and no cross-column search over it either). Omit it and the kind is INFERRED from the column's values (#58): "range" when every present value is a finite number (and there is at least one); "values" when the distinct string forms of the present values number at most 20 (VALUES_FILTER_MAX_DISTINCT) and at most half the present rows, so the checklist is shorter than the column it filters; "text" otherwise, including an empty table. Null and undefined do not count as present. An explicit kind always wins; the inference re-runs when rows changes, and a column whose inferred kind flips drops its filter value (the two kinds store different shapes). Rows path only: UGM columns stay "text".

    header: string

    Header text, also the label in the column-visibility menu.

    hidden?: boolean

    Hidden by default (#58): the column starts toggled off in column visibility, so the column menu still lists it and the user can show it. A column that arrives hidden in a later column set is hidden too; a visibility change made by the user is kept.

    id: string

    Stable column id (test ids and visibility state key off it).

    render?: (value: unknown, row: T) => ReactNode

    Renders the cell; defaults to the stringified value, with null/undefined shown as a dash. A table-wide renderCell that returns a non-undefined node takes precedence.

    title?: string

    Header tooltip (#58): the title attribute on the sort trigger, for a longer description of a short header.

    value: (row: T) => unknown

    Reads the sortable, filterable value out of a row.

    width?: string | number

    Column width (#58): px as a number, or any CSS width. Applied to the header cell; the table otherwise sizes to content.