0
votes

this is the problem.

I have a store in which I have a fiels without typization named al_key The al_key actually comes as an int from the server

{ al_key: 5512, description: "test"}

I load those data into a gridpanel, then I edit the Record with a Form that takes the Record from the row. In the form I have a combobox named "AL VALUE" preselected with the al_key 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
}

Now, the problem is: when I load the Record (getForm().loadRecord(rec)) the field al_key is a number and when I submit the form it sends a number. When I change the value of the combo the fiel al_key becomes a STRING and it sends a STRING!

How can I force to use integer?

Thank you Al.

2
Can we see the complete store (AlStore) definition? - Hines Bourne

2 Answers

0
votes

I'm sorry... It seems a problem of the FormPanel. When I call : this.page.dataGrid.store.insert(0, new this.page.dataGrid.store.recordType(this.getForm().getValues())); the this.getForm().getValues() returns this object: al_key: "4088" cod_aerom: "1458"

WHY??!

0
votes

SOLVED! THe problem is that the FORM doesn't know about the store configuration and it passes all data as a normal form. So, if I fill the store in this way: this.page.dataGrid.store.recordType(this.getForm().getValues())); it will insert all strings. Here is my workaround..

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.