Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 5.4 KB

category-tree-datasource.service.md

File metadata and controls

58 lines (48 loc) · 5.4 KB
Title Added Status Last reviewed
Category tree datasource service
v6.0.0.0
Active
2023-01-25

Datasource service for category tree.

Class members

Methods

  • appendNodes(nodeToAppend: CategoryNode, subNodes: CategoryNode[])
    Append more child nodes to already expanded parent node

    • nodeToAppend: CategoryNode - Expanded parent node
    • subNodes: CategoryNode[] - List of nodes that will be added as children of expanded node
  • collapseNode(nodeToCollapse: CategoryNode)
    Collapses a node removing all children from it.

  • connect(): Observable<CategoryNode[]>

  • disconnect()

  • expandNode(nodeToExpand: CategoryNode, subNodes: CategoryNode[])
    Expands node applying subnodes to it.

    • nodeToExpand: CategoryNode - Node to be expanded
    • subNodes: CategoryNode[] - List of nodes that will be added as children of expanded node
  • getChildren(parentNode: CategoryNode): CategoryNode[]
    Gets children of the node

  • getParentNode(parentNodeId: string): CategoryNode|undefined
    Gets parent node of given node. If node with parentNodeId is not found it returns undefined.

    • parentNodeId: string - Id of a parent node to be found
    • Returns CategoryNode|undefined - parent node or undefined when not found
  • getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable<TreeResponse<CategoryNode>>
    Gets categories as nodes for category tree.

    • parentNodeId: string - Identifier of a parent category
    • skipCount: number - (Optional) Number of top categories to skip
    • maxItems: number - (Optional) Maximum number of subcategories returned from
    • name: string - (Optional) Optional parameter which specifies if categories should be filtered out by name or not. If not specified then returns categories without filtering.
    • Returns Observable<TreeResponse<CategoryNode>> -
  • isEmpty(): boolean
    Checks if tree is empty

    • Returns boolean - boolean
  • removeNode(node: CategoryNode)
    Removes provided node from the tree

Details

Category tree datasource service acts as datasource for tree component utilizing category service. See the Tree component and Tree service to get more details on how datasource is used.