转自: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);
????????});
?????}
????}
???}
??}
?});
});
?????