My jstree function is here.
I have set \'select_limit\' : 3
, but is not working. when I run, I am able to select more than 3 nodes, but I need to select no
select_limit
doens't handle checkbox you must roll your own before.jstree
method.
j1.bind("before.jstree", function (e, data) {
if (data.func === "check_node") {
if (j1.jstree('get_checked').length >= 1) {
e.preventDefault();
return false;
}
}
});
Note that this code if for example only, and doesn't handle child nodes
Working fiddle: http://jsfiddle.net/cfb9J/1/
There is another option missing, probably need to add the ui module, try this:
j1("#utree_activity").jstree({
"plugins" : ["html_data","ui"],
//the rest of your code
});