我有一个jsTree复选框,显示出来很好。我可以打开 并关闭节点,选中并取消选中复选框等。jsTree复选框插件错误
问题出现在我试图获取所有已检测到 的节点时。下面列出了我尝试过的所有方法,以及我尝试使用每个错误时收到的错误 。
$.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
第二个(.jstree.plugin.checkbox $)似乎得到了 最接近的工作,但它似乎并不喜欢“复选框” 参考。应该是check_box还是不同的东西?
这是我用来初始化树代码:
$.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"]
});
});
当然所有的括号都关闭? – Harmen 2010-10-21 22:02:15
是的,所有的括号都在那里,我只是没有像我应该做的那样做好复制和粘贴工作。树完美无瑕。只有当我尝试调用get_checked时,才会遇到未定义的错误。 – irrational 2010-10-22 19:43:41