Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to disable js tree. I tried many ways. But I am unable to disable jstree. I am binding the tree in div tag. So I tried to disable the div tag but it did not work.


C#
function createJSTrees(data1) {
               $("#divsearchResult").jstree({


                   "json_data": {
                       "data": $.parseJSON(data1)


                   },
                   "plugins": ["checkbox", "themes", "json_data", "ui"]
               });

              $("#divsearchResult").children().attr("disabled", "disabled");
           }

       });



--atleast if I can disable the checkbox that would be fine. I tried to google it. I got this way the answers.

"types" : {
"types": {
"disabled" : {
"check_node" : false,
"uncheck_node" : false
}
}
}


so I modified this way

C#
function createJSTrees(data1) {
               $("#divsearchResult").jstree({


                   "json_data": {
                       "data": $.parseJSON(data1),
                       "types": {
                           "types": {
                               "disabled": {
                                   "check_node": false,
                                   "uncheck_node": false
                               }
                           }
                       }


                   },
                   "plugins": ["checkbox", "themes", "json_data", "ui"]
               });

              $("#divsearchResult").children().attr("disabled", "disabled");
           }

       });







but unable to do. Kindly help me out.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900