Disable node

Hi,

I could not find anywhere in the documentation as to disable certain node of the treeview.    I would like to make some node and their children greyed out and non clickable.

Is this possible?.  Thank you.

3 Replies

MK Muthukrishnan Kandasamy Syncfusion Team March 9, 2020 12:02 PM UTC

Hi Albert, 
 
Thanks for contacting Syncfusion support. 
 
We would like to inform you that, we have provided the disableNodes method to disable the TreeView nodes by specifying the Id of nodes. When we disable the parent node using disableNodes method, it will disable only the parent node and not its child nodes. Please refer to the below code block. 
 
click(){ 
      this.tree.disableNodes(["01-02","01-02-01", "01-02-02"]); 
    } 
 
The disabled nodes will be expanded or collapsed while clicking the expand or collapse icon. If you want to disable this action means then please add the below code, 
 
.e-treeview .e-list-item.e-disable .e-icons{ 
      pointer-events: none; 
    } 
 
 
 
We have prepared sample for your convenience, please refer to the below link for the sample. 
 
 
 
Please let us know, if you need any assistance. 
 
Regards, 
Muthukrishnan K 



AK Albert K March 10, 2020 01:11 AM UTC

Thank you for the example.  This is what I am looking for.


MK Muthukrishnan Kandasamy Syncfusion Team March 10, 2020 05:06 AM UTC

Hi Albert, 
 
Thanks for your update. 
 
 
We are glad to know that given solution works. Please let us know if you need any further assistance. 
 
 
Regards, 
Muthukrishnan K 


Loader.
Up arrow icon