flexlayout-react
    Preparing search index...

    Class Model

    Class containing the Tree of Nodes used by the FlexLayout component

    Index
    MAIN_LAYOUT_ID: string = "__main_layout_id__"
    • Register a change listener (ModelChangeListener or legacy function). Fires for every action, including direct model.doAction calls.

      Parameters

      Returns void

    • Update the node tree by performing the given action, Actions should be generated via static methods on the Actions class

      Parameters

      • action: Action

        the action to perform

      Returns any

      added Node for Actions.addTab, layoutId for createPopout

    • Get the currently active tabset node

      Parameters

      • layoutId: string = Model.MAIN_LAYOUT_ID

      Returns TabSetNode | undefined

    • Finds the first/top left tab set of the given node.

      Parameters

      • node: Node | undefined = ...

        The top node you want to begin searching from, deafults to the root node

      Returns TabSetNode | undefined

      The first Tab Set

    • Get the currently maximized tabset node

      Parameters

      • layoutId: string = Model.MAIN_LAYOUT_ID

      Returns TabSetNode | undefined

    • Gets a node by its id

      Parameters

      • id: string

        the id to find

      Returns Node | undefined

    • Gets the root RowNode of the model

      Parameters

      • layoutId: string = Model.MAIN_LAYOUT_ID

      Returns RowNode | undefined

    • Returns number | undefined

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Removes a listener previously registered with addChangeListener (either a function or a ModelChangeListener object)

      Parameters

      Returns void

    • Sets a function to allow/deny dropping a node

      Parameters

      • onAllowDrop: (dragNode: Node, dropInfo: DropInfo) => boolean

        function that takes the drag node and DropInfo and returns true if the drop is allowed

      Returns void

    • set callback called when a new TabSet is created. The tabNode can be undefined if it's the auto created first tabset in the root row (when the last tab is deleted, the root tabset can be recreated)

      Parameters

      Returns void

    • Parameters

      • Optionalsize: number

      Returns void

    • Converts the model to a json object

      Returns IJsonModel

      json object that represents this model

    • Returns string

    • Parameters

      • layoutId: string
      • fn: (node: Node, level: number) => void

      Returns void

    • Visits all the nodes in the model and calls the given function for each

      Parameters

      • fn: (node: Node, level: number) => void

        a function that takes visited node and a integer level as parameters

      Returns void

    • Pairs the global attribute definitions with the node attribute definitions so that an inherited node attribute can resolve its type/description/default from the global attribute it maps to (and vice versa), e.g. tabEnableClose <-> enableClose. Idempotent; called automatically when the definitions are accessed.

      Returns void

    • Load a model from JSON.

      Parameters

      • json: IJsonModel
      • OptionalpreviousModel: Model

        optional; when given, matching tabs adopt its view state (no remount).

      Returns Model