2013-05-03 59 views
0

这是问题所在。extjs 3.4 ComboBox发送错误的数据类型

我有一个店,我有没有叫al_key typization的al_key其实来自一个int从

{ al_key: 5512, description: "test"} 

我这些数据加载到一个GridPanel中的服务器fiels,然后我编辑与记录从行中获取记录的表单。在表格中,我有一个名为“AL VALUE”的组合框,它预先用al_key键。现在

{ 
    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_key是一个数字,并且当我提交表单它发送一个数。 当我改变组合的值时,场地al_key变成了STRING,并且它发送了STRING!

我该如何强制使用整数?

谢谢。

+0

我们可以看到完整的商店(AlStore)定义吗? – 2013-05-03 20:44:56

回答

0

已解决! 问题是FORM不知道商店配置,它以普通形式传递所有数据。 因此,如果我以这种方式填充商店: 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.

0

对不起... 这似乎是一个FormPanel的问题。 当我打电话:this.page.dataGrid.store.insert(0, new this.page.dataGrid.store.recordType(this.getForm().getValues()));this.getForm().getValues()返回此对象: al_key: "4088" cod_aerom: "1458"

为什么?!