最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Automatically checkuncheck all subtree nodes in extjs tree when certain node gets checkedunckecked - Stack Overflow

programmeradmin3浏览0评论

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.

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.

Share Improve this question edited May 23, 2017 at 11:52 CommunityBot 11 silver badge asked Jul 5, 2011 at 8:24 alexalex 8335 gold badges12 silver badges21 bronze badges 1
  • Which version of ExtJS are you using? – dmackerman Commented Jul 6, 2011 at 15:19
Add a comment  | 

1 Answer 1

Reset to default 23

I found a solution:

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

tree.on('checkchange', oncheckchange, null);
发布评论

评论列表(0)

  1. 暂无评论