File

qwc/projects/qwc/src/lib/components/qwc-tree/qwc-tree.component.ts

Description

Component to create tree

Implements

OnInit OnChanges FocusableOption

Metadata

selector qwc-tree
templateUrl qwc-tree.component.html

Index

Properties
Methods
Inputs
Outputs
HostListeners

Constructor

constructor(treeService: QwcTreeService, element: ElementRef)
Parameters :
Name Type Optional
treeService QwcTreeService No
element ElementRef No

Inputs

activeNode
Type : any
config
Type : QwcTreeConfig
Default value : { childKey: "child", showCheckbox: false, isExpandedTree: false, showExpandCollapse: true, showHierarchyLines: false }
isRoot
Default value : false
node
Type : any
rootId
Type : string
selectedNodes
Type : any

Outputs

nodeSelected
Type : EventEmitter

HostListeners

keydown
Arguments : '$event'
keydown(event: KeyboardEvent)

Methods

expandTrigger
expandTrigger(treeNode, actionBtn)

Node trigger handler to collapse/expand nodes

Parameters :
Name Optional Description
treeNode No

Actual node

actionBtn No

Button node to change icon

Returns : void

void

focus
focus()
Returns : void
getSelectedNode
getSelectedNode()

Get selected node

Returns : any

void

ngOnChanges
ngOnChanges(changes: SimpleChanges)

Component lifecycle hook

Parameters :
Name Type Optional Description
changes SimpleChanges No

Changes

Returns : void

void

ngOnInit
ngOnInit()

Component lifecycle hook

Returns : void

void

setItemCheckbox
setItemCheckbox(item, value)

To check all the decendent items

Parameters :
Name Optional Description
item No

Tree node/item

value No

checkbox state as same state need to set for all child items

Returns : void

void

treeNodeSelected
treeNodeSelected(node)

Tree node selected

Parameters :
Name Optional
node No
Returns : void

void

Properties

CSS_CLASSES
Type : object
Default value : { BRANCH: "tree-branch", BRANCH_HIDE: "tree-branch--hide", NODE_ACTION_COLLAPSE: "tree-node-action--collapse", NODE_ACTION_EXPAND: "tree-node-action--expand" }
treeNodesContainer
Type : ElementRef
Decorators :
@ViewChild('treeNodesContainer')

result-matching ""

    No results matching ""