ext 得到 j已定义id的元素
用Ext.getCmp(‘')即可得到进行操作。
例如:
- var test=new Ext.Panel({
- renderTo:"hello-dialog",
- id:"hello",
- title:"面板头部header",
- width:300,
- height:200,
- html:'<h1>面板主区域</h1>',
- tbar:[{text:'顶部工具栏topToolbar'}],
- bbar:[{text:'底部工具栏bottomToolbar'}],
- buttons:[{text:"按钮位于footer"}]
- });
用 var test =Ext.getCmp(‘hello');
alert(test.id);
输出 hello