ExtJs4.0 TreePanel+CheckBox全选

Js代码   收藏代码
  1. var mytree = new Ext.tree.TreePanel({  
  2.     id: 'ppdTree',  
  3.     x: 5,  
  4.     y: 5,  
  5.     width: 378,  
  6.     height: 470,  
  7.     useArrows: true,  
  8.     autoScroll: true,  
  9.     animate: true,  
  10.     enableDD: true,  
  11.     containerScroll: true,  
  12.     store: new Ext.data.TreeStore  
  13.                 ({  
  14.                     proxy:  
  15.                     {  
  16.                         type: 'ajax',  
  17.                         url: 'data/User/UserPopedom.aspx?parameter=ppdTree&userId=' + userId  
  18.                     },  
  19.                     root:  
  20.                     {  
  21.                         id: 0,  
  22.                         text: "选择权限",  
  23.                         leaf: false,  
  24.                         expandable: true,  
  25.                         expanded: true  
  26.                     },  
  27.                     sorters: [  
  28.                     {  
  29.                         property: 'leaf',  
  30.                         direction: 'ASC'  
  31.                     },  
  32.                     {  
  33.                         property: 'text',  
  34.                         direction: 'ASC'  
  35.                     }]  
  36.                 })  
  37. });  
  38. mytree.on('checkchange'function (node, checked) {  
  39.     node.expand();  
  40.     node.checked = checked;  
  41.     node.eachChild(function (child) {  
  42.         child.set('checked', checked);  
  43.         child.fireEvent('checkchange', child, checked);  
  44.     });  
  45. }, mytree);  

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值