在可检查的树面板中,我希望自动检查已检查节点的所有子节点。我怎么能这样做?
答案 0 :(得分:1)
尝试将这样的侦听器添加到树存储中:
listeners: {
update: function(store,node,op,modifiedFields){
//If our checked value has changed
if(modifiedFields && Ext.Array.contains(modifiedFields,'checked')){
var isChecked = node.get('checked');
node.eachChild(function(childNode){
//set each child node to it's parent's checked value
childNode.set('checked',isChecked);
});
}
}
}