【发布时间】:2015-09-03 11:59:39
【问题描述】:
我在我的应用程序中使用 JSTree 并使用以下代码。
this.CreateTreeView = function () {
$('#jstree_demo_div').jstree({
'core': {
'multiple': false,
'data': [
{ "id": "ajson1", "parent": "#", "text": "Simple root node" },
{ "id": "ajson2", "parent": "#", "text": "Root node 2" },
{ "id": "ajson3", "parent": "ajson2", "text": "Child 1" },
{ "id": "ajson4", "parent": "ajson2", "text": "Child 2" },
]
}
});
}
如我的代码所示,我正在尝试禁用多选。
现在当我使用以下代码选择节点时。
$("#jstree_demo_div").jstree().select_node("ajson3");
$("#jstree_demo_div").jstree().select_node("ajson4");
它仍然选择两个节点。所以它变成了 Javascript 中的多选。
我提出这个问题只是为了确认 JSTree 的工作是否正确?
我知道我可以在使用deselect_all 函数选择任何节点之前取消选择所有节点。
但根据我的说法,如果多项选择设置为 false,那么从 javascript 中选择节点也应该只选择一个节点。
如果我错了,请纠正我。
【问题讨论】:
标签: javascript jquery jstree