我有一个 jstree JQuery 插件,我使用它的“复选框”插件。我需要以编程方式选择复选框并以编程方式禁用复选框。
我怎么能这样做?
https://groups.google.com/forum/?fromgroups#!topic/jstree/wLokkEg3eCY%5B1-25%5D这个我试过没有结果。
我的杰斯特里:
var myTree = $(tree).jstree({
"json_data": {
"ajax": {
type: "POST",
async: true,
"url": urlTree,
// data: '{"longnames":"' + flag + '"}',
data: function (n) {
id = n.attr ? n.attr("id") : prefix + '0';
reply = '{ id: "' + id + '"';
// if (dataJSON.length > 0) {
// reply = reply + ", " + dataJSON;
// }
reply += ', longnames: "' + flag + '"';
// reply += ", prefix: ";
// reply += (mutateIds != 1) ? '' : '"' + prefix + '"';
reply += "}";
return reply
},
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
success: function (msg) {
return msg.d.data;
},
error: function () {
// process error of ajax
return false;
}
},
// "xsl": "flat",
},
"search": {
"show_only_matches": true,
"search_method": "jstree_contains"
},
"types": {
"max_children": -2,
"max_depth": -2,
"default": {
"valid_children": ["default"],
"select_node": function (e) {
this.toggle_node(e);
return false;
}
},
"disabled" : {
"check_node" : false,
"uncheck_node" : false
}
},
"cookies": {
"save_opened": false
},
"checkbox":{
"override_ui": "true",
"real_checkboxes": "true"
},
"plugins": pluginsToUse
})