当特定节点被检查/未被击中时,自动检查/取消选中extjs树中的所有子树节点 [英] Automatically check/uncheck all subtree nodes in extjs tree when certain node gets checked/unckecked

查看:153
本文介绍了当特定节点被检查/未被击中时,自动检查/取消选中extjs树中的所有子树节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当某个节点被检查/未被打开时,如何自动检查/取消选中一个extjs树中的所有子树节点。我已经有我的树与复选框。唯一缺少的是这种检查/解除行为。我发现这一点:检查子节点一个父母被点击的树[ExtJS] ,但它不适用于我,因为extjs API似乎被更改。

How do I automatically check/uncheck all subtree nodes in an extjs tree when a certain node gets checked/unckecked. I already have my tree with checkboxes. The only thing missing is this check/unckeck behavior. I found this: check child nodes of a tree when a parent is clicked [ExtJS] , but it doesn't work for me because the the extjs API seems to be changed.

推荐答案

我找到一个解决方案:

oncheckchange = function(node, checked, options){
    node.cascadeBy(function(n){n.set('checked', checked);} );
};

tree.on('checkchange', oncheckchange, null);

这篇关于当特定节点被检查/未被击中时,自动检查/取消选中extjs树中的所有子树节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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