学习ExtJS(六) 访问容器对象

一、属性
ownerCt:得到当前对象所在的容器。
items:集合列表
二、应用举例
Ext.onReady(function(){
        var _window 
= new Ext.Window({
                            title:
"测试窗体",
                            layout:
"form",
                            width:
300,
                            plain:
true,
                            items:{
                                id:
"name",
                                xtype:
"textfield",
                                fieldLabel:
"姓名"
                            },
                            
                            buttons:[{
                                text:
"确定",
                                handler:function(){
                                    alert(
this.ownerCt.ownerCt.items.first().getValue()) ;
                                    alert(
this.ownerCt.ownerCt.items.itemAt(0).getValue()) ;
                                    alert(Ext.getCmp(
"name").getValue()) ;
                                
                                }
                            }]
                      }) ;
        _window.show() ;            
    }) ;
posted @ 2009-10-06 08:58  EasyPass  阅读(516)  评论(0编辑  收藏  举报