Trilium Frontend API
    Preparing search index...

    Interface ColumnComponent

    interface ColumnComponent {
        delete: () => Promise<void>;
        getCells: () => CellComponent[];
        getDefinition: () => ColumnDefinition;
        getElement: () => HTMLElement;
        getField: () => string;
        getHeaderFilterValue: () => any;
        getNextColumn: () => false | ColumnComponent;
        getParentColumn: () => false | ColumnComponent;
        getPrevColumn: () => false | ColumnComponent;
        getSubColumns: () => ColumnComponent[];
        getTable: () => Tabulator;
        getWidth: () => number;
        headerFilterFocus: () => void;
        hide: () => void;
        isVisible: () => boolean;
        move: (toColumn: ColumnLookup, after: boolean) => void;
        popup: (contents: string, position: PopupPosition) => void;
        reloadHeaderFilter: () => void;
        scrollTo: (
            position?: "left" | "middle" | "right",
            scrollIfVisible?: boolean,
        ) => Promise<void>;
        setHeaderFilterValue: (value: any) => void;
        setWidth: (width: number | true) => void;
        show: () => void;
        toggle: () => void;
        updateDefinition: (
            definition: ColumnDefinition,
        ) => Promise<ColumnComponent>;
        validate: () => true | CellComponent[];
    }
    Index

    Properties

    delete: () => Promise<void>

    The delete function deletes the column, removing it from the table.

    getCells: () => CellComponent[]

    The getCells function returns an array of CellComponent objects, one for each cell in the column.

    getDefinition: () => ColumnDefinition

    The getDefinition function returns the column definition object for the column.

    getElement: () => HTMLElement

    The getElement function returns the DOM node for the colum.

    getField: () => string

    The getField function returns the field name for the column.

    getHeaderFilterValue: () => any

    Get the current header filter value of a column.

    getNextColumn: () => false | ColumnComponent

    The getNextColumn function returns the Column Component for the next visible column in the table, if there is no next column it will return a value of false.

    getParentColumn: () => false | ColumnComponent

    The getParentColumn function returns the ColumnComponent for the parent column of this column. if no parent exists, this function will return false.

    getPrevColumn: () => false | ColumnComponent

    The getPrevColumn function returns the Column Component for the previous visible column in the table, if there is no previous column it will return a value of false.

    getSubColumns: () => ColumnComponent[]

    The getSubColumns function returns an array of ColumnComponent objects, one for each sub column of this column.

    getTable: () => Tabulator

    The getTable function returns the Tabulator object for the table containing the column.

    getWidth: () => number

    Returns the width of the column in pixels

    headerFilterFocus: () => void

    The headerFilterFocus function will place focus on the header filter element for this column if it exists.

    hide: () => void

    The hide function hides the column if it is visible.

    isVisible: () => boolean

    The isVisible function returns a boolean to show if the column is visible, a value of true means it is visible.

    move: (toColumn: ColumnLookup, after: boolean) => void

    You can move a column component next to another column using the move function.

    popup: (contents: string, position: PopupPosition) => void
    reloadHeaderFilter: () => void

    The reloadHeaderFilter function rebuilds the header filter element, updating any params passed into the editor used to generate the filter.

    scrollTo: (
        position?: "left" | "middle" | "right",
        scrollIfVisible?: boolean,
    ) => Promise<void>

    The scrollTo function will scroll the table to the column if it is visible.

    setHeaderFilterValue: (value: any) => void

    The setHeaderFilterValue function set the value of the columns header filter element to the value provided in the first argument.

    setWidth: (width: number | true) => void

    You can set the width of a column using the setWidth function, passing the width of the column in pixes as an integer as the first argument.Passing a value of true to the function will resize the column to fit its contents

    show: () => void

    The show function shows the column if it is hidden.

    toggle: () => void

    The toggle function toggles the visibility of the column, switching between hidden and visible.

    updateDefinition: (definition: ColumnDefinition) => Promise<ColumnComponent>

    Update the definition of a column. It is worth noting that using this function actually replaces the old column with a totally new column component, therefore any references to the previous column component will no longer work after this function has been run. The function will return a promise that will resolve when the column has been updated, passing in the updated column component as an argument.

    validate: () => true | CellComponent[]

    You can validate a column

    This will return a value of true if every cell passes validation, if any cells fail, then it will return an array of Cell Components representing each cell in that column that has failed validation.