如何禁用jstree或禁用jstree的复选框 [英] how to disable a jstree or disable the checkbox of jstree
问题描述
我想禁用js树。我尝试了很多方法。但是我无法禁用jstree。我在div标签中绑定树。所以我试图禁用div标签,但它不起作用。
function createJSTrees(data1 ){
$( #divsearchResult)。jstree({
json_data:{
data:$ .parseJSON(data1)
},
plugins:[ 复选框, themes, json_data, ui]
});
$( #divsearchResult)。children()。attr( disabled, 禁用跨度>);
}
});
--atleast如果我可以禁用复选框就可以了。我试着去谷歌吧。我有这样的答案。
类型:{
类型:{
禁用:{
check_node:false,
uncheck_node:false
}
} < br $>
}
所以我修改了这个方式
function createJSTrees(data1){
$( #divsearchResult )。jstree({
json_data:{
data:$ .parseJSON(data1),
types:{
types:{
disabled:{
check_node: false ,
uncheck_node: false
}
}
}
},
插件 :[ 复选框, < span class =code-string> themes, json_data, ui]
});
$( #divsearchResult)。children()。attr( disabled, 禁用跨度>);
}
});
但无法做到。请帮助我。
( #divsearchResult )。jstree({
json_data:{
data:
< blockquote> .parseJSON(data1)
},
插件:[ 复选框, themes, json_data, ui]
});
( #divsea rchResult)。children()。attr( disabled, disabled);
}
});
--atleast如果我可以禁用复选框就可以了。我试着去谷歌吧。我有这样的答案。
类型:{
类型:{
禁用:{
check_node:false,
uncheck_node:false
}
} < br $>
}
所以我修改了这个方式
function createJSTrees(data1){
I want to disable js tree. I tried many ways. But I am unable to disable jstree. I am binding the tree in div tag. So I tried to disable the div tag but it did not work.
function createJSTrees(data1) {
$("#divsearchResult").jstree({
"json_data": {
"data": $.parseJSON(data1)
},
"plugins": ["checkbox", "themes", "json_data", "ui"]
});
$("#divsearchResult").children().attr("disabled", "disabled");
}
});
--atleast if I can disable the checkbox that would be fine. I tried to google it. I got this way the answers.
"types" : {
"types": {
"disabled" : {
"check_node" : false,
"uncheck_node" : false
}
}
}
so I modified this way
function createJSTrees(data1) {
$("#divsearchResult").jstree({
"json_data": {
"data": $.parseJSON(data1),
"types": {
"types": {
"disabled": {
"check_node": false,
"uncheck_node": false
}
}
}
},
"plugins": ["checkbox", "themes", "json_data", "ui"]
});
$("#divsearchResult").children().attr("disabled", "disabled");
}
});
but unable to do. Kindly help me out.
("#divsearchResult").jstree({ "json_data": { "data":
.parseJSON(data1) }, "plugins": ["checkbox", "themes", "json_data", "ui"] });
("#divsearchResult").children().attr("disabled", "disabled"); } });
--atleast if I can disable the checkbox that would be fine. I tried to google it. I got this way the answers.
"types" : {
"types": {
"disabled" : {
"check_node" : false,
"uncheck_node" : false
}
}
}
so I modified this way
function createJSTrees(data1) {
这篇关于如何禁用jstree或禁用jstree的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!