mithril-materialized
    Preparing search index...

    Interface DataTableColumn<T>

    Configuration for a DataTable column

    interface DataTableColumn<T = Record<string, any>> {
        align?: "left" | "right" | "center";
        cellRenderer?: FactoryComponent<CellRendererAttrs<T>>;
        className?: string;
        field?: keyof T;
        filterable?: boolean;
        headerClassName?: string;
        key: string;
        render?: (
            value: any,
            row: T,
            index: number,
        ) => string | number | Vnode<{}, {}> | Vnode<{}, {}>[];
        sortable?: boolean;
        title: string;
        width?: string;
    }

    Type Parameters

    • T = Record<string, any>

      The type of the data object for each row

    Index

    Properties

    align?: "left" | "right" | "center"

    Text alignment within cells

    cellRenderer?: FactoryComponent<CellRendererAttrs<T>>

    Custom cell renderer component for advanced cell content

    className?: string

    CSS class applied to all cells in this column

    field?: keyof T

    Property name in the data object to display. If not provided, the entire row object is passed to the renderer

    filterable?: boolean

    Enable global search filtering for this column

    headerClassName?: string

    CSS class applied to the column header

    key: string

    Unique identifier for the column (required for sorting/filtering)

    render?: (
        value: any,
        row: T,
        index: number,
    ) => string | number | Vnode<{}, {}> | Vnode<{}, {}>[]

    Use cellRenderer instead - Legacy render function for cell content

    sortable?: boolean

    Enable sorting for this column

    title: string

    Display title shown in the column header

    width?: string

    CSS width value (e.g., '100px', '20%', '10rem')