2013-05-03 22 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"

爲什麼?!