@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Interface IFilterableTreeDatasource<T>

    Optional tree filtering capability.

    Implement this interface alongside ITreeDatasource when the datasource supports filtering hierarchical data. This is commonly used by UIMasterDetailView in tree mode.

    interface IFilterableTreeDatasource<T = unknown> {
        filterBy(expression: CompiledFilter<T> | null | undefined): void;
        getChildren(node: TreeNode<T>): TreeNode<T>[] | Promise<TreeNode<T>[]>;
        getRootNodes(): TreeNode<T>[] | Promise<TreeNode<T>[]>;
        hasChildren(node: TreeNode<T>): boolean;
    }

    Type Parameters

    • T = unknown

      The data payload type.

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Apply a filter expression to the tree datasource.

      This should update the internal state to reflect filtered tree structure. Subsequent calls to getRootNodes() and getChildren() should return filtered data.

      Parameters

      • expression: CompiledFilter<T> | null | undefined

        The filter expression to apply.

      Returns void

    • Returns the children of the given node.

      The default implementation reads node.children. Override this method to support lazy-loading children from a remote source.

      Parameters

      • node: TreeNode<T>

        The parent node whose children are requested.

      Returns TreeNode<T>[] | Promise<TreeNode<T>[]>

    • Returns the root-level nodes of the tree.

      May return synchronously or as a Promise for lazy-loaded trees.

      Returns TreeNode<T>[] | Promise<TreeNode<T>[]>

    • Returns true if the node has children (or might have children that can be lazy-loaded).

      The default implementation checks node.children?.length > 0.

      Parameters

      Returns boolean