用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
本文通过一个具体实例展示了如何使用Ext.getCmp方法获取已创建的Ext.Panel组件并对其进行操作。该实例创建了一个包含标题、工具栏和按钮的面板,并通过Ext.getCmp方法获取了这个面板,最后输出了面板的id。
1460

被折叠的 条评论
为什么被折叠?



