I have a jstree with checkboxes that shows up just fine. I can open and close the nodes, check and uncheck the checkboxes, etc.
The problem comes in when I try to get all the nodes that have been checked. Below I list all the ways I have tried, along with the error messages I get when I try each one.
$.tree.plugin.checkbox.get_checked($.tree.reference("#smuDomains"));
$.tree is undefined
$.jstree.plugin.checkbox.get_checked($.jstree.reference("#smuDomains"));
$.jstree.plugin.checkbox is undefined
$.tree.plugins.checkbox.get_checked($.tree.reference("#smuDomains"));
$.tree is undefined
$.jstree.plugins.checkbox.get_checked($.jstree.reference("#smuDomains"));
$.jstree.plugins is undefined
The second one ($.jstree.plugin.checkbox) seems to be getting the closest to working, but it doesn't seem to like the "checkbox" reference. Should it be check_box or something different?
This is the code I use to init the tree:
$.jstree._themes = "../script/css/jstree/themes/";
$("#smuDomains").jstree({
core : {},
themes : {
theme : "classic",
dots : true,
icons : true,
url : false
},
json_data : {
ajax : {
url : "[the url]",
datatype : "json",
data : function(n) {
return { id : n.attr ? n.attr("id") : 0 };
},
plugins : [ "themes", "json_data", "ui", "checkbox"]
});
});