关于ext中FormPanel中显示的时候初始化界面上的输入框的值

Gzd2003 2010-05-27 02:15:03
各位大哥,我用ext写了以下一个FormPanel,我想让这个FormPanel显示之后界面上的输入框里写上后台传过来的数据,我该如何做呢?
我在下面FormPanel中写了以下
listeners:
{
load: function()
{
//Ext.getCmp(last.id).setValue("aaa");

}
}
运行不起作用?我该如何写呢?
var formDetail = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 0,
url:'getBaoMingStdInfo.do',
//defaultType: 'textfield',

items: [{
layout:'column',
items:[{
columnWidth:.5,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: 'First Name',
name: 'first',
anchor:'95%'
}, {
xtype:'textfield',
fieldLabel: 'Company',
name: 'company',
anchor:'95%'
}]
},
{
columnWidth:.5,
layout: 'form',
items: [
{
xtype:'textfield',
fieldLabel: 'Last Name',
name: 'last',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Email',
name: 'email',
vtype:'email',
anchor:'95%'
}]
},
{
columnWidth:.5,
layout: 'form',
items: [
{
xtype:'textfield',
fieldLabel: 'Last Name',
name: 'last',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Email',
name: 'email',
vtype:'email',
anchor:'95%'
}]
}]
}],

listeners:
{
load: function()
{
//Ext.getCmp(last.id).setValue("aaa");

}
}
});
...全文
344 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
HappyKeKe 2010-05-27
  • 打赏
  • 举报
回复
你的listeners没写哪个的监听啊

listeners:{
show:function(p)
{
//.......
}
}

这样试试
EXITOUT 2010-05-27
  • 打赏
  • 举报
回复
帮楼主顶下~
Gzd2003 2010-05-27
  • 打赏
  • 举报
回复
小弟刚学ext,感觉缺乏资料呀。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧