5.4 KiB
Title, Added, Status, Last reviewed
| Title | Added | Status | Last reviewed |
|---|---|---|---|
| Category tree datasource service | v6.0.0.0 | Active | 2023-01-25 |
Category tree datasource service
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
- nodeToAppend:
-
collapseNode(nodeToCollapse:
CategoryNode)
Collapses a node removing all children from it.- nodeToCollapse:
CategoryNode- Node to be collapsed
- nodeToCollapse:
-
connect():
Observable<CategoryNode[]>- Returns
Observable<CategoryNode[]>-
- Returns
-
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
- nodeToExpand:
-
getChildren(parentNode:
CategoryNode):CategoryNode[]
Gets children of the node- parentNode:
CategoryNode- Parent node - Returns
CategoryNode[]- children of parent node
- parentNode:
-
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
- parentNodeId:
-
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>>-
- parentNodeId:
-
isEmpty():
boolean
Checks if tree is empty- Returns
boolean- boolean
- Returns
-
removeNode(node:
CategoryNode)
Removes provided node from the tree- node:
CategoryNode- Node to be removed
- node:
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.