关于ext中FormPanel中显示的时候初始化界面上的输入框的值
各位大哥,我用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");
}
}
});