1 this.dynamicPanel = new Ext.Panel({ 2 region: ‘center‘, 3 frame: false, 4 border: false, 5 layout:‘fit‘, 6 items:[ 7 this.createDynamicPanel(‘Retailers‘) 8 ] 9 });
1 createDynamicPanel:function(panelType){ 2 if(panelType==‘Retailers‘){ 3 return new Ext.ux.RetailersPanel(); 4 } 5 }, 6 onRetailersFire:function(){ 7 var dynamicPanel = this.dynamicPanel; 8 dynamicPanel.removeAll(); //移除panel中的所有元素 9 dynamicPanel.add(this.createDynamicPanel(‘Retailers‘)); 10 dynamicPanel.doLayout(); //重新渲染panel(Extjs4中直接添加即可,无需重新渲染) 11 }
Extjs3 动态panel
时间: 2024-09-18 01:32:30