Trilium Frontend API
    Preparing search index...

    Interface RowComponent

    interface RowComponent {
        addTreeChild: (
            rowData: {},
            position?: boolean,
            existingRow?: RowComponent,
        ) => void;
        delete: () => Promise<void>;
        deselect: () => void;
        freeze: () => void;
        getCell: (column: string | HTMLElement | ColumnComponent) => CellComponent;
        getCells: () => CellComponent[];
        getData: () => { [key: string]: any };
        getElement: () => HTMLElement;
        getGroup: () => GroupComponent;
        getIndex: () => any;
        getNextRow: () => false | RowComponent;
        getPosition: (filteredPosition?: boolean) => number | false;
        getPrevRow: () => false | RowComponent;
        getTable: () => Tabulator;
        getTreeChildren: () => RowComponent[];
        getTreeParent: () => false | RowComponent;
        isFrozen: () => boolean;
        isSelected: () => boolean;
        isTreeExpanded: () => boolean;
        move: (
            lookup: number | HTMLElement | RowComponent,
            belowTarget?: boolean,
        ) => void;
        normalizeHeight: () => void;
        pageTo: () => Promise<void>;
        reformat: () => void;
        scrollTo: (
            position?: "center" | "top" | "bottom" | "nearest",
            scrollIfVisible?: boolean,
        ) => Promise<void>;
        select: () => void;
        toggleSelect: () => void;
        treeCollapse: () => void;
        treeExpand: () => void;
        treeToggle: () => void;
        unfreeze: () => void;
        update: (data: {}) => Promise<void>;
        validate: () => true | CellComponent[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    addTreeChild: (
        rowData: {},
        position?: boolean,
        existingRow?: RowComponent,
    ) => void

    Add child rows to a data tree row

    The first argument should be a row data object. If you do not pass data for a column, it will be left empty. To create a blank row (ie for a user to fill in), pass an empty object to the function.

    The second argument is optional and determines whether the row is added to the top or bottom of the array of child rows. A value of true will add the row to the top of the array, a value of false will add the row to the bottom of the array. If the parameter is not set the row will be placed according to the addRowPos global option.

    If you want to add the row next to an existing row you can pass an optional third argument to the function that will position the new row next to the specified row (above or below based on the value of the second argument). This argument will take any of the standard row component look up options. This must be a row that has the same parent as the row you want to add

    delete: () => Promise<void>

    The delete function deletes the row, removing its data from the table

    The delete method returns a promise, this can be used to run any other commands that have to be run after the row has been deleted. By running them in the promise you ensure they are only run after the row has been deleted.

    deselect: () => void

    The deselect function will deselect the current row.

    freeze: () => void

    You can freeze a row at the top of the table by calling the freeze function. This will insert the row above the scrolling portion of the table in the table header.

    getCell: (column: string | HTMLElement | ColumnComponent) => CellComponent

    The getCell function returns the CellComponent for the specified column from this row.

    getCells: () => CellComponent[]

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

    getData: () => { [key: string]: any }

    The getData function returns the data object for the row.

    getElement: () => HTMLElement

    The getElement function returns the DOM node for the row.

    getGroup: () => GroupComponent

    When using grouped rows, you can retrieve the group component for the current row using the getGroup function.

    getIndex: () => any

    The getIndex function returns the index value for the row. (this is the value from the defined index column, NOT the row's position in the table).

    getNextRow: () => false | RowComponent

    The getNextRow function returns the Row Component for the next visible row in the table, if there is no next row it will return a value of false.

    getPosition: (filteredPosition?: boolean) => number | false

    Use the getPosition function to retrieve the numerical position of a row in the table. By default this will return the position of the row in all data, including data currently filtered out of the table.

    If you want to get the position of the row in the currently filtered/sorted data, you can pass a value of true to the optional first argument of the function.

    getPrevRow: () => false | RowComponent

    The getNextRow function returns the Row Component for the previous visible row in the table, if there is no next row it will return a value of false.

    getTable: () => Tabulator

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

    getTreeChildren: () => RowComponent[]

    When the tree structure is enabled the getTreeChildren function will return an array of Row Components for this rows children.

    getTreeParent: () => false | RowComponent

    When the tree structure is enabled the getTreeParent function will return the Row Component for the parent of this row. If no parent exists, a value of false will be returned.

    isFrozen: () => boolean

    The isFrozen function on a Row Component will return a boolean representing the current frozen state of the row.

    isSelected: () => boolean

    The isSelected function will return a boolean representing the current selected state of the row.

    isTreeExpanded: () => boolean

    Returns a value indicating if the current row is expanded.

    move: (
        lookup: number | HTMLElement | RowComponent,
        belowTarget?: boolean,
    ) => void

    You can move a row next to another row using the move function.

    The first argument should be the target row that you want to move to, and can be any of the standard row component look up options.

    The second argument determines whether the row is moved to above or below the target row. A value of false will cause to the row to be placed below the target row, a value of true will result in the row being placed above the target

    normalizeHeight: () => void

    If you are making manual adjustments to elements contained within the row, it may sometimes be necessary to recalculate the height of all the cells in the row to make sure they remain aligned. Call the normalizeHeight function to do this.

    pageTo: () => Promise<void>

    The pageTo function will load the page for the row if it passes the current filters.

    reformat: () => void

    If you want to re-format a row once it has been rendered to re-trigger the cell formatters and the rowFormatter callback, Call the reformat function.

    scrollTo: (
        position?: "center" | "top" | "bottom" | "nearest",
        scrollIfVisible?: boolean,
    ) => Promise<void>

    The scrollTo function will scroll the table to the row if it passes the current filters.

    select: () => void

    The select function will select the current row.

    toggleSelect: () => void

    The deselect function will toggle the current row.

    treeCollapse: () => void

    When the tree structure is enabled the treeCollapse function will collapse current row and hide its children.

    treeExpand: () => void

    When the tree structure is enabled the treeExpand function will expand current row and show its children.

    treeToggle: () => void

    When the tree structure is enabled the treeToggle function will toggle the collapsed state of the current row.

    unfreeze: () => void

    A frozen row can be unfrozen using the unfreeze function. This will remove the row from the table header and re-insert it back in the table.

    update: (data: {}) => Promise<void>

    You can update the data in the row using the update function. You should pass an object to the function containing any fields you wish to update. This object will not replace the row data, only the fields included in the object will be updated.

    validate: () => true | CellComponent[]

    You can validate the whole table in one go by calling the validate method on the table instance.

    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 row that has failed validation.