我正在使用 jstree 来绑定(bind)数据。我已经选中(选择)所有复选框,还调用了复选框的选中/取消选中事件。它在 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 - 当处理选中/取消选中事件并将所有复选框一起设置为真时,js 树在 ie 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57606867/