Hi Ivan. Thanks for your inputs.
Looks like I was able to implement most of the features.
I am using the ready.jstree refresh.jstree event to control the disable of the nodes.I have a array with the default items, shppoing cart items and use that to disable using the below functions. Its working fine.
data.instance.disable_node(shoppingCartNode);
data.instance.disable_node(shoppingCartNode.children_d);
One issue I noticed.
1) Used $("#jstree_so").jstree(true).refresh();
I see the changed event is getting called each time the tree is loaded. (Deselected, selected events getting fired to instate the state). This was slowing my tree. I didnt set the state plugin. Refresh by default reinstate the state ?
2)So I planned to use $("#jstree_so").jstree(true).refresh(false,true);
This didnt initiated a changed event because we are not reinstating the state. I am using selectedTopParentsArray = instance.get_top_selected(true);
to get the top selected, its also returning the disabled nodes (which are not selected).Is there any other setting I need to change. Below is my tree config (getTreeURL - returns the URL to be called)
"#jstree_demo").jstree({
"core" : {
"multiple" : true,
"animation" : 0,
"check_callback" : false,
"themes" : { "theme": "default", "stripes" : true , "responsive" : true ,"icons": true},
"types" : {
"demo" : {
"icon" : "glyphicon glyphicon-leaf"
}
},