【发布时间】:2019-08-22 10:05:55
【问题描述】:
我正在使用 jstree 来绑定数据。我已经检查(选择)所有复选框,并调用复选框的检查/取消选中事件。它在 Chrome 中工作正常,但在 IE 中我可以处理选中/取消选中事件,但默认情况下它没有选中(选择)所有复选框。
请查看以下代码:
$('#filterResult').jstree({
"core": {
"data": data,
"themes": {
"icons": false
},
check_callback: false
},
'checkbox': {
three_state: true,
cascade: 'none',
whole_node: false,
tie_selection: false, // when remove this then all checkbox are selected by dafualt but check/uncheck event is not working
real_checkboxes: true
},
"plugins": [
"wholerow",
"checkbox"
]
})
.on('loaded.jstree', function () {
$("#filterResult").jstree().check_all(true);
// $("#filterResult").jstree("select_all");
})
.on("check_node.jstree uncheck_node.jstree", function (e, data) {
console.log(data.node.id);
}
});
当我从 'checkbox' 中删除 tie_selection: false 然后选择 IE 中的所有复选框都可以正常工作,但随后复选框选中/取消选中事件不起作用。
以上代码在 Chrome 中运行。
【问题讨论】:
标签: javascript jquery jstree jstree-dnd