Trilium Frontend API
    Preparing search index...

    Interface ColumnDefinition

    interface ColumnDefinition {
        accessor?: "rownum" | CustomAccessor;
        accessorClipboard?: CustomAccessor;
        accessorClipboardParams?: CustomAccessorParams;
        accessorDownload?: CustomAccessor;
        accessorDownloadParams?: CustomAccessorParams;
        accessorHtmlOutput?: CustomAccessor;
        accessorHtmlOutputParams?: CustomAccessorParams;
        accessorParams?: CustomAccessorParams;
        accessorPrint?: CustomAccessor;
        accessorPrintParams?: CustomAccessorParams;
        bottomCalc?: ColumnCalc;
        bottomCalcFormatter?: Formatter;
        bottomCalcFormatterParams?: FormatterParams;
        bottomCalcParams?: ColumnCalcParams;
        cellClick?: CellEventCallback;
        cellContext?: CellEventCallback;
        cellDblClick?: CellEventCallback;
        cellDblTap?: CellEventCallback;
        cellEditCancelled?: CellEditEventCallback;
        cellEdited?: CellEditEventCallback;
        cellEditing?: CellEditEventCallback;
        cellMouseDown?: CellEventCallback;
        cellMouseEnter?: CellEventCallback;
        cellMouseLeave?: CellEventCallback;
        cellMouseMove?: CellEventCallback;
        cellMouseOut?: CellEventCallback;
        cellMouseOver?: CellEventCallback;
        cellMouseUp?: CellEventCallback;
        cellPopup?:
            | string
            | (
                (
                    e: MouseEvent,
                    component: ColumnComponent | CellComponent | RowComponent,
                    onRendered: () => any,
                ) => any
            );
        cellTap?: CellEventCallback;
        cellTapHold?: CellEventCallback;
        clickMenu?: (MenuSeparator | MenuObject<CellComponent>)[];
        clipboard?: boolean | ((column: ColumnComponent) => boolean);
        columns?: ColumnDefinition[];
        contextMenu?: (MenuSeparator | MenuObject<CellComponent>)[];
        cssClass?: string;
        dblClickMenu?: (MenuSeparator | MenuObject<CellComponent>)[];
        dblClickPopup?: string;
        download?: boolean | ((column: ColumnComponent) => boolean);
        editable?: boolean | ((cell: CellComponent) => boolean);
        editableTitle?: boolean;
        editor?: Editor;
        editorEmptyValue?: any;
        editorEmptyValueFunc?: (value: unknown) => boolean;
        editorParams?: EditorParams;
        field?: string;
        formatter?: Formatter;
        formatterClipboard?: false | Formatter;
        formatterClipboardParams?: FormatterParams;
        formatterHtmlOutput?: false | Formatter;
        formatterHtmlOutputParams?: FormatterParams;
        formatterParams?: FormatterParams;
        formatterPrint?: false | Formatter;
        formatterPrintParams?: FormatterParams;
        frozen?: boolean;
        headerClick?: ColumnEventCallback;
        headerContext?: ColumnEventCallback;
        headerContextMenu?: (MenuObject<ColumnComponent> | MenuSeparator)[];
        headerDblClick?: ColumnEventCallback;
        headerDblClickMenu?: (MenuSeparator | MenuObject<CellComponent>)[];
        headerDblClickPopup?: string;
        headerDblTap?: ColumnEventCallback;
        headerFilter?: Editor;
        headerFilterEmptyCheck?: ValueBooleanCallback;
        headerFilterFunc?: FilterType | HeaderFilterFunc;
        headerFilterFuncParams?: any;
        headerFilterLiveFilter?: boolean;
        headerFilterParams?: EditorParams;
        headerFilterPlaceholder?: string;
        headerHozAlign?: ColumnDefinitionAlign;
        headerMenu?:
            | (MenuObject<ColumnComponent> | MenuSeparator)[]
            | (
                (
                    e: MouseEvent,
                    component: ColumnComponent,
                ) => (MenuObject<ColumnComponent> | MenuSeparator)[]
            );
        headerMenuIcon?:
            | string
            | HTMLElement
            | ((component: ColumnComponent) => string | HTMLElement);
        headerMouseDown?: ColumnEventCallback;
        headerMouseUp?: ColumnEventCallback;
        headerSort?: boolean;
        headerSortStartingDir?: SortDirection;
        headerSortTristate?: boolean;
        headerTap?: ColumnEventCallback;
        headerTapHold?: ColumnEventCallback;
        headerTooltip?: string | boolean | ((column: ColumnComponent) => string);
        headerVertical?: boolean | "flip";
        headerWordWrap?: boolean;
        hideInHtml?: boolean;
        hozAlign?: ColumnDefinitionAlign;
        htmlOutput?: boolean | ((column: ColumnComponent) => boolean);
        maxWidth?: number | false;
        minWidth?: number;
        mutator?: CustomMutator;
        mutatorClipboard?: CustomMutator;
        mutatorClipboardParams?: CustomMutatorParams;
        mutatorData?: CustomMutator;
        mutatorDataParams?: CustomMutatorParams;
        mutatorEdit?: CustomMutator;
        mutatorEditParams?: CustomMutatorParams;
        mutatorParams?: CustomMutatorParams;
        print?: boolean | ((column: ColumnComponent) => boolean);
        resizable?: boolean | "header" | "cell";
        responsive?: number;
        rowHandle?: boolean;
        sorter?:
            | "string"
            | "number"
            | "boolean"
            | "date"
            | "datetime"
            | "time"
            | "alphanum"
            | "exists"
            | "array"
            | (
                (
                    a: any,
                    b: any,
                    aRow: RowComponent,
                    bRow: RowComponent,
                    column: ColumnComponent,
                    dir: SortDirection,
                    sorterParams: {},
                ) => number
            );
        sorterParams?:
            | ColumnDefinitionSorterParams
            | ColumnSorterParamLookupFunction;
        title: string;
        titleClipboard?: string;
        titleDownload?: string;
        titleFormatter?: Formatter;
        titleFormatterParams?: FormatterParams;
        titleHtmlOutput?: string;
        titlePrint?: string;
        tooltip?: string
        | GlobalTooltipOption;
        topCalc?: ColumnCalc;
        topCalcFormatter?: Formatter;
        topCalcFormatterParams?: FormatterParams;
        topCalcParams?: ColumnCalcParams;
        validator?: string | StandardValidatorType[] | Validator | Validator[];
        variableHeight?: boolean;
        vertAlign?: VerticalAlign;
        visible?: boolean;
        width?: string | number;
        widthGrow?: number;
        widthShrink?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    accessor? accessorClipboard? accessorClipboardParams? accessorDownload? accessorDownloadParams? accessorHtmlOutput? accessorHtmlOutputParams? accessorParams? accessorPrint? accessorPrintParams? bottomCalc? bottomCalcFormatter? bottomCalcFormatterParams? bottomCalcParams? cellClick? cellContext? cellDblClick? cellDblTap? cellEditCancelled? cellEdited? cellEditing? cellMouseDown? cellMouseEnter? cellMouseLeave? cellMouseMove? cellMouseOut? cellMouseOver? cellMouseUp? cellPopup? cellTap? cellTapHold? clickMenu? clipboard? columns? contextMenu? cssClass? dblClickMenu? dblClickPopup? download? editable? editableTitle? editor? editorEmptyValue? editorEmptyValueFunc? editorParams? field? formatter? formatterClipboard? formatterClipboardParams? formatterHtmlOutput? formatterHtmlOutputParams? formatterParams? formatterPrint? formatterPrintParams? frozen? headerClick? headerContext? headerContextMenu? headerDblClick? headerDblClickMenu? headerDblClickPopup? headerDblTap? headerFilter? headerFilterEmptyCheck? headerFilterFunc? headerFilterFuncParams? headerFilterLiveFilter? headerFilterParams? headerFilterPlaceholder? headerHozAlign? headerMenu? headerMenuIcon? headerMouseDown? headerMouseUp? headerSort? headerSortStartingDir? headerSortTristate? headerTap? headerTapHold? headerTooltip? headerVertical? headerWordWrap? hideInHtml? hozAlign? htmlOutput? maxWidth? minWidth? mutator? mutatorClipboard? mutatorClipboardParams? mutatorData? mutatorDataParams? mutatorEdit? mutatorEditParams? mutatorParams? print? resizable? responsive? rowHandle? sorter? sorterParams? title titleClipboard? titleDownload? titleFormatter? titleFormatterParams? titleHtmlOutput? titlePrint? tooltip? topCalc? topCalcFormatter? topCalcFormatterParams? topCalcParams? validator? variableHeight? vertAlign? visible? width? widthGrow? widthShrink?

    Properties

    accessor?: "rownum" | CustomAccessor

    Accessors are used to alter data as it is extracted from the table, through commands, the clipboard, or download.

    You can set accessors on a per column basis using the accessor option in the column definition object.

    accessorClipboard?: CustomAccessor

    only called when data is being copied into the clipboard.

    accessorClipboardParams?: CustomAccessorParams

    Additional parameters you can pass to the accessorClipboard.

    accessorDownload?: CustomAccessor

    only called when data is being converted into a downloadable file.

    accessorDownloadParams?: CustomAccessorParams

    additional parameters you can pass to the accessorDownload.

    accessorHtmlOutput?: CustomAccessor

    You can use the accessorHtmlOutput and accessorHtmlOutputParams options on a column definition to alter the value of data in a column before the html is generated.

    accessorHtmlOutputParams?: CustomAccessorParams
    accessorParams?: CustomAccessorParams

    Each accessor function has its own matching params option, for example accessorDownload has accessorDownloadParams.

    accessorPrint?: CustomAccessor

    You can use the accessorPrint and accessorPrintParams options on a column definition to alter the value of data in a column before it is printed.

    accessorPrintParams?: CustomAccessorParams
    bottomCalc?: ColumnCalc
    bottomCalcFormatter?: Formatter
    bottomCalcFormatterParams?: FormatterParams

    additional parameters you can pass to the bottomCalcFormatter function.

    bottomCalcParams?: ColumnCalcParams
    cellClick?: CellEventCallback

    callback for when user clicks on a cell in this column.

    cellContext?: CellEventCallback

    callback for when user right clicks on a cell in this column.

    cellDblClick?: CellEventCallback

    callback for when user double clicks on a cell in this column.

    cellDblTap?: CellEventCallback

    callback for when user double taps on a cell in this column, triggered in touch displays when a user taps the same cell twice in under 300ms.

    cellEditCancelled?: CellEditEventCallback

    callback for when an edit on a cell in this column is aborted by the user.

    callback for when a cell in this column has been edited by the user.

    cellEditing?: CellEditEventCallback

    callback for when a cell in this column is being edited by the user.

    cellMouseDown?: CellEventCallback
    cellMouseEnter?: CellEventCallback

    callback for when the mouse pointer enters a cell

    cellMouseLeave?: CellEventCallback

    callback for when the mouse pointer leaves a cell

    cellMouseMove?: CellEventCallback

    callback for when the mouse pointer moves over a cell.

    cellMouseOut?: CellEventCallback

    callback for when the mouse pointer enters a cell or one of its child elements

    cellMouseOver?: CellEventCallback

    callback for when the mouse pointer enters a cell or one of its child elements

    cellMouseUp?: CellEventCallback
    cellPopup?:
        | string
        | (
            (
                e: MouseEvent,
                component: ColumnComponent | CellComponent | RowComponent,
                onRendered: () => any,
            ) => any
        )

    Popups work in a similar way to menus, but instead of only displaying lists of menu items they allow you to fill them with any custom content you like, text, input elements, forms, anything you fancy.

    callback for when user taps on a cell in this column, triggered in touch displays.

    cellTapHold?: CellEventCallback

    callback for when user taps and holds on a cell in this column, triggered in touch displays when a user taps and holds the same cell for 1 second.

    clipboard?: boolean | ((column: ColumnComponent) => boolean)

    If you don't want to show a particular column in the clipboard output you can set the clipboard property in its column definition object to false.

    columns?: ColumnDefinition[]

    A column can be a "group" of columns (Example: group header column -> Measurements, grouped column -> Length, Width, Height)

    You can add a right click context menu to any columns cells by passing an array of menu items to the contextMenu option in that columns definition.

    cssClass?: string

    sets css classes on header and cells in this column. (value should be a string containing space separated class names)

    dblClickMenu?: (MenuSeparator | MenuObject<CellComponent>)[]
    dblClickPopup?: string
    download?: boolean | ((column: ColumnComponent) => boolean)

    show or hide column in downloaded data

    editable?: boolean | ((cell: CellComponent) => boolean)

    There are some circumstances where you may want to block edit-ability of a cell for one reason or another. To meet this need you can use the editable option. This lets you set a callback that is executed before the editor is built, if this callback returns true the editor is added, if it returns false the edit is aborted and the cell remains a non editable cell. The function is passed one parameter, the CellComponent of the cell about to be edited. You can also pass a boolean value instead of a function to this property.

    editableTitle?: boolean

    allows the user to edit the header titles

    editor?: Editor

    When a user clicks on an editable column the will be able to edit the value for that cell.

    By default Tabulator will use an editor that matches the current formatter for that cell. if you wish to specify a specific editor, you can set them per column using the editor option in the column definition. Passing a value of true to this option will result in Tabulator applying the editor that best matches the columns formatter, if present.

    You can pass an optional additional parameter with the editor, editorParams that should contain an object with additional information for configuring the editor.

    editorEmptyValue?: any

    The value to set in the cell after the user has finished editing the cell.

    editorEmptyValueFunc?: (value: unknown) => boolean

    The function to determine if the value is empty.

    editorParams?: EditorParams

    additional parameters you can pass to the editor.

    field?: string

    field - Required (not required in icon/button columns) this is the key for this column in the data array.

    formatter?: Formatter

    Set how you would like the data to be formatted.

    formatterClipboard?: false | Formatter

    When copying to the clipboard you may want to apply a different formatter from the one usually used to format the cell, you can do this using the formatterClipboard column definition option. You can use the formatterClipboardParams to pass in any additional params to the formatter.

    formatterClipboardParams?: FormatterParams
    formatterHtmlOutput?: false | Formatter

    When the getHtml function is called you may want to apply a different formatter from the one usually used to format the cell, you can do this using the formatterHtmlOutput column definition option.

    formatterHtmlOutputParams?: FormatterParams
    formatterParams?: FormatterParams

    You can pass an optional additional parameter with the formatter, formatterParams that should contain an object with additional information for configuring the formatter.

    formatterPrint?: false | Formatter

    When printing you may want to apply a different formatter from the one usually used to format the cell, you can do this using the formatterPrint column definition option. You can use the formatterPrintParams to pass in any additional params to the formatter.

    formatterPrintParams?: FormatterParams
    frozen?: boolean

    You can freeze the position of columns on the left and right of the table using the frozen property in the column definition array. This will keep the column still when the table is scrolled horizontally.

    headerClick?: ColumnEventCallback

    Callback for when user clicks on the header for this column.

    headerContext?: ColumnEventCallback

    Callback for when user right clicks on the header for this column.

    headerContextMenu?: (MenuObject<ColumnComponent> | MenuSeparator)[]

    You can add a right click context menu to any column by passing an array of menu items to the headerContextMenu option in that columns definition.

    headerDblClick?: ColumnEventCallback

    Callback for when user double clicks on the header for this column.

    headerDblClickMenu?: (MenuSeparator | MenuObject<CellComponent>)[]
    headerDblClickPopup?: string
    headerDblTap?: ColumnEventCallback

    callback for when user double taps on a header for this column, triggered in touch displays when a user taps the same header twice in under 300ms

    headerFilter?: Editor

    filtering of columns from elements in the header.

    headerFilterEmptyCheck?: ValueBooleanCallback

    function to check when the header filter is empty

    headerFilterFunc?: FilterType | HeaderFilterFunc

    By default Tabulator will try and match the comparison type to the type of element used for the header filter.

    Standard input elements will use the "like" filter, this allows for the matches to be displayed as the user types.

    For all other element types (select boxes, check boxes, input elements of type number) an "=" filter type is used.

    If you want to specify the type of filter used you can pass it to the headerFilterFunc option in the column definition object. This will take any of the standard filters outlined above or a custom function

    headerFilterFuncParams?: any

    additional parameters object passed to the headerFilterFunc function.

    headerFilterLiveFilter?: boolean

    disable live filtering of the table.

    headerFilterParams?: EditorParams

    additional parameters you can pass to the header filter.

    headerFilterPlaceholder?: string

    placeholder text for the header filter.

    headerHozAlign?: ColumnDefinitionAlign
    headerMenu?:
        | (MenuObject<ColumnComponent> | MenuSeparator)[]
        | (
            (
                e: MouseEvent,
                component: ColumnComponent,
            ) => (MenuObject<ColumnComponent> | MenuSeparator)[]
        )

    You can add a menu to any column by passing an array of menu items to the headerMenu option in that columns definition.

    headerMenuIcon?:
        | string
        | HTMLElement
        | ((component: ColumnComponent) => string | HTMLElement)

    The headerMenuIcon option will accept one of three types of value. You can pass in a string for the HTML contents of the button. Or you can pass the DOM node for the button. Though be careful not to pass the same node to multiple columns or you may run into issues. Or you can define a function that is called when the column header is rendered that should return either an HTML string or the contents of the element. This function is passed the column component as its first argument.

    headerMouseDown?: ColumnEventCallback
    headerMouseUp?: ColumnEventCallback
    headerSort?: boolean

    By default all columns in a table are sortable by clicking on the column header, if you want to disable this behavior, set the headerSort property to false in the column definition array:

    headerSortStartingDir?: SortDirection

    set the starting sort direction when a user first clicks on a header.

    headerSortTristate?: boolean

    allow tristate toggling of column header sort direction.

    callback for when user taps on a header for this column, triggered in touch displays.

    headerTapHold?: ColumnEventCallback

    callback for when user taps and holds on a header for this column, triggered in touch displays when a user taps and holds the same header for 1 second.

    headerTooltip?: string | boolean | ((column: ColumnComponent) => string)

    sets the on hover tooltip for the column header* * The tooltip headerTooltip can take three different types of value

    • boolean - a value of false disables the tooltip, a value of true sets the tooltip of the column header to its title value.
    • string - a string that will be displayed for the tooltip.
    • function - a callback function that returns the string for the column header*
    headerVertical?: boolean | "flip"

    Change the orientation of the column header to vertical* * The headerVertical property can take one of three values:

    • false - vertical columns disabled (default value)
    • true - vertical columns enabled
    • "flip" - vertical columns enabled, with text direction flipped by 180 degrees*
    headerWordWrap?: boolean
    hideInHtml?: boolean

    When the getHtml function is called, hide the column from the output.

    If you want to set the horizontal alignment on a column by column basis,

    htmlOutput?: boolean | ((column: ColumnComponent) => boolean)

    Show/Hide a particular column in the HTML output.

    maxWidth?: number | false
    minWidth?: number

    sets the minimum width of this column, this should be set in pixels

    mutator?: CustomMutator

    Mutators are used to alter data as it is parsed into For example if you wanted to convert a numeric column into a boolean based on its value, before the data is used to build the table.

    You can set mutators on a per column basis using the mutator option in the column definition object.

    You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator.

    mutatorClipboard?: CustomMutator

    only called when data is changed via a user editing a cell.

    mutatorClipboardParams?: CustomMutatorParams
    mutatorData?: CustomMutator

    only called when data is loaded via a command {eg. setData).

    mutatorDataParams?: CustomMutatorParams
    mutatorEdit?: CustomMutator

    only called when data is changed via a user editing a cell.

    mutatorEditParams?: CustomMutatorParams
    mutatorParams?: CustomMutatorParams

    You can pass an optional additional parameter with mutator, mutatorParams that should contain an object with additional information for configuring the mutator.

    print?: boolean | ((column: ColumnComponent) => boolean)

    If you don't want to show a particular column in the print table you can set the print property in its column definition object to false.

    resizable?: boolean | "header" | "cell"

    set whether column can be resized by user dragging its edges

    responsive?: number

    an integer to determine when the column should be hidden in responsive mode.

    rowHandle?: boolean

    sets the column as a row handle, allowing it to be used to drag movable rows.

    sorter?:
        | "string"
        | "number"
        | "boolean"
        | "date"
        | "datetime"
        | "time"
        | "alphanum"
        | "exists"
        | "array"
        | (
            (
                a: any,
                b: any,
                aRow: RowComponent,
                bRow: RowComponent,
                column: ColumnComponent,
                dir: SortDirection,
                sorterParams: {},
            ) => number
        )

    By default Tabulator will attempt to guess which sorter should be applied to a column based on the data contained in the first row. It can determine sorters for strings, numbers, alphanumeric sequences and booleans, anything else will be treated as a string. To specify a sorter to be used on a column use the sorter property in the columns definition object

    You can pass an optional additional property with sorter, sorterParams that should contain an object with additional information for configuring the sorter

    If you want to dynamically generate the sorterParams at the time the sort is called you can pass a function into the property that should return the params object.

    title: string

    title - Required This is the title that will be displayed in the header for this column.

    titleClipboard?: string

    When copying to clipboard you may want to apply a different column header title from the one usually used in the table. You can now do this using the titleClipboard column definition option, which takes the same inputs as the standard title property.

    titleDownload?: string

    set custom title for column in download.

    titleFormatter?: Formatter

    formatter function for header title.

    titleFormatterParams?: FormatterParams

    additional parameters you can pass to the header title formatter.

    titleHtmlOutput?: string

    When the getHtml function is called you may want to apply a different column header title from the one usually used in the table. You can now do this using the titleHtmlOutput column definition option, which takes the same inputs as the standard title property.

    titlePrint?: string

    When printing you may want to apply a different column header title from the one usually used in the table. You can now do this using the titlePrint column definition option, which takes the same inputs as the standard title property.

    tooltip?: string | GlobalTooltipOption

    Sets the on hover tooltip for each cell in this column * * The tooltip parameter can take three different types of value:

    • boolean - a value of false disables the tooltip, a value of true sets the tooltip of the cell to its value
    • string - a string that will be displayed for all cells in the matching column/table.
    • function - a callback function that returns the string for the cell Note: setting a tooltip value on a column will override the global setting.
    topCalc?: ColumnCalc

    the column calculation to be displayed at the top of this column(see Column Calculations for more details)

    topCalcFormatter?: Formatter

    Formatter for the topCalc calculation cell.

    topCalcFormatterParams?: FormatterParams

    additional parameters you can pass to the topCalcFormatter function.

    topCalcParams?: ColumnCalcParams

    additional parameters you can pass to the topCalc calculation function (see Column Calculations for more details)

    validator?: string | StandardValidatorType[] | Validator | Validator[]

    Validators are used to ensure that any user input into your editable cells matches your requirements.

    Validators can be applied by using the validator property in a columns definition object (see Define Columns for more details).

    variableHeight?: boolean

    alter the row height to fit the contents of the cell instead of hiding overflow

    vertAlign?: VerticalAlign

    If you want to set the vertical alignment on a column by column basis

    visible?: boolean

    visible - (boolean, default - true) determines if the column is visible. (see Column Visibility for more details

    width?: string | number

    sets the width of this column, this can be set in pixels or as a percentage of total table width (if not set the system will determine the best)

    widthGrow?: number

    The widthGrow property should be used on columns without a width property set. The value is used to work out what fraction of the available will be allocated to the column. The value should be set to a number greater than 0, by default any columns with no width set have a widthGrow value of 1

    widthShrink?: number

    The widthShrink property should be used on columns with a width property set. The value is used to work out how to shrink columns with a fixed width when the table is too narrow to fit in all the columns. The value should be set to a number greater than 0, by default columns with a width set have a widthShrink value of 0, meaning they will not be shrunk if the table gets too narrow, and may cause the horizontal scrollbar to appear.