您可以使用以下代码来设置 ComboTree 控件的勾选:

// 获取 ComboTree 控件对象
var comboTree = $('#comboTree').combotree('tree');

// 获取所有选中的节点
var checkedNodes = comboTree.tree('getChecked');

// 遍历所有节点
comboTree.tree('getChildren').forEach(function(node) {
  // 如果节点在选中节点中,则设置勾选状态为 true
  if (checkedNodes.some(function(checkedNode) { return checkedNode.id === node.id; })) {
    comboTree.tree('check', node.target);
  }
});

使用以上代码,您可以将 ComboTree 控件中已选中的节点,设置为已勾选状态。

combotree 设置勾选

原文地址: https://www.cveoy.top/t/topic/fTBh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录