当前位置: 代码迷 >> Web前端 >> ext 四 check tree 联动选择
  详细解决方案

ext 四 check tree 联动选择

热度:624   发布时间:2012-09-28 00:03:35.0
ext 4 check tree 联动选择

转自:http://yaoba.iteye.com/blog/1006445

?

?


?var tree = Ext.create('Ext.tree.Panel', {
??.....
??viewConfig : {
???onCheckboxChange : function(e, t) {
????var item = e.getTarget(this.getItemSelector(), this
????????.getTargetEl()), record;
????if (item) {
?????record = this.getRecord(item);
?????var check = !record.get('checked');
?????record.set('checked', check);

?????if (check) {
??????record.bubble(function(parentNode) {
?????????parentNode.set('checked', true);
????????});
??????record.cascadeBy(function(node) {
?????????node.set('checked', true);
????????});
?????} else {
??????record.cascadeBy(function(node) {
?????????node.set('checked', false);
????????});
?????}
????}
???}
??}
?});
});

?????

  相关解决方案