现在的位置: 首页 > 综合 > 正文

ext 动态更新items

2013年09月11日 ⁄ 综合 ⁄ 共 1244字 ⁄ 字号 评论关闭

首先父元素的不能是border布局,可以设置一个无布局的panel,来包装有border 布局的panel,这样只需删除和添加这些有布局的panel,保持无布局panel不变即可,例如:

              patient_visitgrid = new com.sinosoft.patientVisitGrid({
                    title:'随访列表',
                    collapsible : true,
                    frame : true,
                    region : 'south',
                    height:100
                });
                patient_grid = new com.sinosoft.patientmanagerGrid({
                    frame : true,
                    region : 'center',
                });

                patient_result_panel = new Ext.Panel( {
                    layout:'border',
                    items:[patient_grid,patient_visitgrid],
                    collapsible : true,
                    height:310,
                    region : 'center',
                    frame : true,
                });

                    result_panel = new Ext.Panel( {
                        items:[ patient_result_panel],
                        collapsible : true,
                        height:320,
                        region : 'south',
                        frame : true,
                        title:'查询结果'
                    });
                   
                     vp = new Ext.Viewport( {
                        layout:'border',
                        items:[querypanel,result_panel]
                    });

需要移除和添加时调用
resultPanel.remove(patient_result_panel ),   
resultPanel.add(provider_result_panel ),  
result_panel.doLayout();

即可

抱歉!评论已关闭.