Extjs 树形设置选中

在Extjs中treepanel中树节点为checkbox类的节时,有时候我们需要用程序来设置他的选中和取消选中状态
var nodes=tree.getChecked(); 
if(nodes && nodes.length){
 for(var i=0;i<nodes.length;i++){
  //设置UI状态为未选中状态
  nodes[i].getUI().toggleCheck(false);
  //设置节点属性为未选中状态
  nodes[i].attributes.checked=false;
 }
}
这样通过获取已选择的节点,用程序取消选择状态
反之可以设置未选中节点选中状态
原文地址:https://www.cnblogs.com/starm/p/2075212.html