标签:
xtype:‘treepanel‘, store: menuStore, id:‘menuTreePanel‘, viewConfig : { //checkbox联动 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); parentNode.expand(false, true); }); record.cascadeBy(function(node) { node.set(‘checked‘, true); node.expand(false, true); }); } else { record.cascadeBy(function(node) { node.set(‘checked‘, false); }); } } } }, /* selModel: { selType: ‘checkboxmodel‘ },*/ columns: [ { xtype:‘treecolumn‘,text: ‘菜单名称‘,width:450, dataIndex: ‘text‘,sortable:false}, { text: ‘菜单ID‘,hidden:true,hideable:false, dataIndex: ‘id‘,align:‘center‘,sortable:false} ]
效果图:
效果图[extjs] ExtJS4 treepanel 子节点选中父节点自动选中,选中父节点 子节点自动全部选中
标签:
原文地址:http://www.cnblogs.com/lonelywolfmoutain/p/5668869.html