当父点击时检查树的子节点[ExtJS] [英] check child nodes of a tree when a parent is clicked [ExtJS]

查看:139
本文介绍了当父点击时检查树的子节点[ExtJS]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在ExtJs中点击一个特定的节点来检查一棵树的兄弟节点。



我给每个节点添加了id,我可以访问点击的节点的ID。那么我该如何继续自动检查子节点?



有人请帮助我..

解决方案

  //或任何其他方式在您要使用的节点上获取
var node = treePanel.getNodeById('your-id );
node.eachChild(function(n){
n.getUI()。toggleCheck(true);
});

如果你想让这个工作在当前节点的整个子树上,你必须做一些递归。



更多集成:

  treePanel.on ('checkchange',function(node,checked){
node.eachChild(function(n){
n.getUI()。toggleCheck(checked);
});
});


I would like to know how can i check the sibling nodes of a tree while clicking on a particular node in ExtJs.

I had given id's for each node and i can access the id of a clicked node. then how can i proceed to checking the child nodes automatically ??

somebody please help me..

解决方案

// or any other way of getting hands on the node you want to work with
var node = treePanel.getNodeById('your-id');
node.eachChild(function(n) {
    n.getUI().toggleCheck(true);
});

If you want this to work on the whole subtree of the current node, you'll have to do some recursion.

A little more integrated:

treePanel.on('checkchange', function(node, checked) {
    node.eachChild(function(n) {
        n.getUI().toggleCheck(checked);
    });
});

这篇关于当父点击时检查树的子节点[ExtJS]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆