Trilium Frontend API
    Preparing search index...

    Class Module

    Index

    Constructors

    • The constructor is called as the module is being instantiated and is where your module should start to tell tabulator a little about itself. The constructor takes one argument, the table the module is being bound to, it should pass this to the super function so that it is available for the module to bind to its internal helper functions. It is very important that you do not try any access any parts of the table, any events or other modules when the constructor is called. At this point the table is in the process of being built and is not ready to respond to anything. The constructor should be used to register any external functionality that may be called on the module and to register andy setup options that may be set on the table or column definitions.

      Parameters

      • table: Tabulator

        The Tabulator object the module is being initialized for

      Returns Module

    Properties

    table: Tabulator

    Reference to the table this module is in

    moduleInitOrder?: number

    The optional static moduleInitOrder property can be used to determine the order in which the module is initialized, by default modules are initialized with a value of 0. If you want your module to be initialized before other modules use a minus number, if you want it initialized after use a positive number.

    moduleName: string

    The static moduleName property must be declared on the class (not an instance of the class), and be a camelCase name for the module, this is used internally by the table to act as a unique identifier for the module.

    Methods

    • Fire an forget an event that can be consumed by external consumers

      Parameters

      • eventName: string

        Event name, must follow the camelCase convention

      • ...args: unknown[]

        Arguments for the event

      Returns void

    • Called by the table when it is ready for module integrations

      Returns void

    • Register an option for the column component

      Parameters

      • propName: string

        Property name to add

      • OptionaldefaultValue: unknown

        Default value of the property

      Returns void

    • Make a function available on the table object

      Parameters

      • functionName: string

        Function to add

      • callback: (...args: unknown[]) => unknown

        Function to be called when the method is invoked on the grid

      Returns void

    • Adds an option to the table constructor

      Parameters

      • propName: string

        Property name to add

      • OptionaldefaultValue: unknown

        Default value of the property

      Returns void

    • Uses the data loader to reload the data in the grid

      Parameters

      • data: string | unknown[]

        New grid data

      • silent: boolean

        Do not trigger any events

      • columnsChanged: boolean

        If the column configuration has changed

      Returns Promise<void>

      a promise that resolves when the data update is competed

    • Updates the configuration of the grid. It should be noted that changing an option will not automatically update the table to reflect that change, you will likely need to call the refreshData function to trigger the update.

      Parameters

      • key: keyof Options

        Key to update

      • value: unknown

        value to set

      Returns void

    • Subscribe to an event in the Tabulator Event bus. See https://tabulator.info/docs/5.5/events-internal

      Parameters

      Returns void

    • Unsubscribe to an event in the Tabulator Event bus. See https://tabulator.info/docs/5.5/events-internal

      Parameters

      • eventName: string

        Event to subscribe to

      • callback: (...args: unknown[]) => unknown

        Function to call when subscribing

      Returns void