How disable or prevent opening wijmo tree node based on condition?

393 Views Asked by At

I want to prevent opening wijmo tree node based on some condition or disabling specific node based on condition. I tried to use 'expandOnClick' property of treeview which prevents the opening of current node but it is possible to open node on clicking glyph icon. I am using wijmo 5.2019 with angular 8.

<wj-tree-view #treeView [itemsSource]="itemsSource" [displayMemberPath]="'Name'" [wjContextMenu]="ctxMenu" [childItemsPath]="'Children'"
(formatItem)="formatItem(treeView, $event)" [allowDragging]="config.canDrag ? true : false" [expandOnClick]="this.openNode">

How can i prevent opening node?

1

There are 1 best solutions below

1
On BEST ANSWER

You can handle the isCollapsedChanging event of the TreeView and cancel the event if the condition match. I have created a demo sample for you here.