Extjs 4.2 动态更新panel内容

来源:互联网 发布:知乎 鬼吹灯 编辑:程序博客网 时间:2024/05/21 09:02

1. 创建panel

[javascript] view plaincopy在CODE上查看代码片派生到我的代码片
  1. var test_panel = Ext.create('widget.panel',{  
  2.     id: 'test_panel_id'  
  3. });  


2. 动态更新

Ext.getCmp('test_panel_id').removeAll();                      test_panel.add(                          Ext.create('widget.panel',{                              id:'test_panel_details_id',                              html: '自行定义,动态更新可写到Ajax success,submit success等处'                          })                      );                                                            Ext.getCmp('test_panel_id').doLayout(true); //别忘了这句


0 0