I have listed data for ASP.net control TreeView. I wanted to disable a particular node/parentnode in the listed TreeView. I wanted to do this using jQuery.
I have listed data for ASP.net control TreeView. I wanted to disable a particular
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you take a simple treenode markup:
Then the default output for a single node is:
At this point you can see that the surrounding the a tag that gets generated receives the css class ‘treeNode’ so to select a specific node you could use the following selector:
$(‘.treeNode:eq(0)’) to get the first node in the tree. there are other selectors you may prefer to use, see the selectors page on jQuery docs.
Then you can do different things.
You can hide the node:
you can replace the a tag with text:
or you can use a 3rd party jquery plugin to block the element (usually good while performing an ajax operation):