I am new to ExtJS4.We are开发者_JS百科 using treepanel in our application.If we select the parent node then the child nodes under that parent are selecting.But if we unselect the parent node i need to unselect hte child nodes under that particular parent node.
My code:
var tree = Ext.create('Ext.tree.Panel',{
id : "tree",
height : 300,
store : treeStore,
rootVisible : false,
hideHeaders : true,
listeners : {
checkchange : function(node,check){
var ex;
ex = node.get('id');
if(!check && 'un' || '')
{
alert('unchecked');
}else if(check){
node.cascadeBy(function(child){
child.set("checked",check);
});
alert('child nodes checked');
}
}
}
});
Here i need to uncheck the child nodes if we uncheck the parent node.
I am trying a lot on this issue.Please help me.
Help would be appreciated.
Regards,
KushalJust use simple version of your code:
checkchange : function(node,check){
node.cascadeBy(function(child){
child.set("checked",check);
});
}
精彩评论