我已经使用jsTree呈现了一个树视图,如果单击复选框图标而不是节点的标签,如何才能选中/取消选中节点?
发布于 2017-03-27 05:11:03
我找到了我自己问题的答案
设置了以下属性之后,它的行为就像预期的那样。
$('#testTree').jstree({
core: {
data: getData,
check_callback: false
},
checkbox: {
three_state : false,
whole_node : false,//Used to check/uncheck node only if clicked on checkbox icon, and not on the whole node including label
tie_selection : false
},
plugins: ['checkbox']
})发布于 2019-07-12 09:56:26
对我来说最有效的是删除jstree选项中的"wholerow“:
所以,从
"plugins": ["wholerow", "checkbox"],至:
"plugins": ["checkbox"],因此,整个jstree配置如下所示:
$('#testTree').jstree({
"core": {
"themes": {
"theme": "default",
"dots": false,
"icons": false
},
"data": @Html.Raw(ViewBag.Menu)
},
"checkbox": {
"keep_selected_style": false,
},
"plugins": ["checkbox"],
});https://stackoverflow.com/questions/43014176
复制相似问题