开发者

ExtJS4 tree panel problem

开发者 https://www.devze.com 2023-03-23 10:51 出处:网络
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

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,

Kushal


Just use simple version of your code:

checkchange : function(node,check){
    node.cascadeBy(function(child){
        child.set("checked",check);
    });
}
0

精彩评论

暂无评论...
验证码 换一张
取 消