Parsing extjs 3.4组合框发送错误的数据类型
这就是问题所在 我有一家商店,在那里我有一个没有打字的名字叫阿尔·凯的地方 al_键实际上是来自服务器的intParsing extjs 3.4组合框发送错误的数据类型,parsing,extjs,combobox,extjs3,Parsing,Extjs,Combobox,Extjs3,这就是问题所在 我有一家商店,在那里我有一个没有打字的名字叫阿尔·凯的地方 al_键实际上是来自服务器的int { al_key: 5512, description: "test"} 我将这些数据加载到gridpanel中,然后用一个从行中获取记录的表单编辑记录。在表单中,我有一个名为“AL VALUE”的组合框,用AL_键预选 { xtype: 'combo', triggerAction: 'all', store: 'AlStore', forceSel
{ al_key: 5512, description: "test"}
我将这些数据加载到gridpanel中,然后用一个从行中获取记录的表单编辑记录。在表单中,我有一个名为“AL VALUE”的组合框,用AL_键预选
{
xtype: 'combo',
triggerAction: 'all',
store: 'AlStore',
forceSelection: true,
allowBlank: true,
editable: false,
fieldLabel: 'AL VALUE',
name: 'al_key',
hiddenName: 'al_key',
displayField: 'text',
valueField: 'id',
disabled: true
}
现在,问题是:当我加载记录(getForm().loadRecord(rec))时,字段al_键是一个数字,当我提交表单时,它会发送一个数字。
当我更改组合键的值时,fiel al_键变成一个字符串,它发送一个字符串
如何强制使用整数
谢谢你,艾尔。对不起。。。
这似乎是模板的问题。
调用时:this.page.dataGrid.store.insert(0,新建this.page.dataGrid.store.recordType(this.getForm().getValues())代码>
this.getForm().getValues()
返回此对象:
al_键:“4088”
科德航空公司:“1458”
为什么 解决了!
问题是表单不知道存储配置,它以普通表单的形式传递所有数据。
因此,如果我以这种方式填充存储:
this.page.dataGrid.store.recordType(this.getForm().getValues())代码>
它将插入所有字符串。
这是我的解决办法
MyRecordType = Ext.data.Record.create(this.page.dataGrid.store.fields.keys);
var myRec = new MyRecordType();
this.getForm().updateRecord(myRec);
this.page.dataGrid.store.add(myRec);
this.page.dataGrid.store.save();
tnx!!
A.我们可以看到完整的商店(AlStore)定义吗?