Ext.onReady(function(){
var _window = new Ext.Window({
title:"测试窗体",
layout:"form",
width:260,
labelWidth:45,
plain:true,
//容器生成文本框
items:[{
xtype:"textfield",
width:180,
fieldLabel:"姓名"
},{
xtype:"textfield",
width:180,
fieldLabel:"密码"
}],
buttons:[{
text:"确定",
//句柄函数的this是指向button
handler:function(){
//ownerCt当前容器对象
//容器对象的集合,
var collection = this.ownerCt.items;
//first(),就是这个文本框
alert(collection.first().getValue());
alert(collection.itemAt(1).getValue());
}
}]
});
_window.show();
})
ExtJS学习笔记六:按钮获取window中的文本域
最新推荐文章于 2019-01-10 11:04:30 发布