Trilium Frontend API
    Preparing search index...

    Interface OptionsPersistentConfiguration

    interface OptionsPersistentConfiguration {
        persistence?: true | PersistenceOptions;
        persistenceID?: string;
        persistenceMode?: true | "local" | "cookie";
        persistenceReaderFunc?: (id: string, type: keyof PersistenceOptions) => any;
        persistenceWriterFunc?: (
            id: string,
            type: keyof PersistenceOptions,
            data: any,
        ) => any;
        persistentFilter?: boolean;
        persistentLayout?: boolean;
        persistentSort?: boolean;
    }

    Hierarchy (View Summary)

    • OptionsPersistentConfiguration
    Index

    Properties

    persistence?: true | PersistenceOptions

    By setting the persistence property to true the table will persist the sort, filter, group (groupBy, groupStartOpen, groupHeader), pagination (paginationSize), and column (title, width, visibility, order) configuration of the table.

    persistenceID?: string

    ID tag used to identify persistent storage information.

    persistenceMode?: true | "local" | "cookie"

    Persistence information can either be stored in a cookie or in the localStorage object, you can use the persistenceMode to choose which. It can take three possible values:

    local - (string) Store the persistence information in the localStorage object cookie - (string) Store the persistence information in a cookie true - (boolean) check if localStorage is available and store persistence information, otherwise store in cookie (Default option)

    persistenceReaderFunc?: (id: string, type: keyof PersistenceOptions) => any

    The persistenceReaderFunc function will receive two arguments, the persistance id of the table, and the type of data to be written. This function must synchronously return the data in the format in which it was passed to the persistenceWriterFunc function. It should return a value of false if no data was present.

    persistenceWriterFunc?: (
        id: string,
        type: keyof PersistenceOptions,
        data: any,
    ) => any

    The persistenceWriterFunc function will receive three arguments, the persistance id of the table, the type of data to be written and an object or array representing the data

    persistentFilter?: boolean

    You can ensure the data filtering is stored for the next page load by setting the persistentFilter option to true.

    persistentLayout?: boolean

    Enable persistent storage of column layout information.

    persistentSort?: boolean

    You can ensure the data sorting is stored for the next page load by setting the persistentSort option to true.