feyyaz
12 Jul 2010, 9:35 AM
I think this is a Bug if i am not doing something wrong.
Here is my simplified code
var myData = new Ext.data.DirectStore({
directFn:Server.getData,
reader: new Ext.data.JsonReader(
{root: 'data', totalProperty: 'total'},
[
{name: 'ID',type: 'int'},
{name: 'name', type: 'string'}
]
),
sortInfo: {field: 'name', direction: "ASC"},
remoteSort:true
});
// only the config of my form for simplicity
{xtype:"form", id:"my-form", methode:"post", title:"Details",
api: {load: Server.load,submit: Server.update},
items: [
{xtype: "combo",
id:"my-combo",
store: myData,
valueField: 'ID',
displayField: 'name',
forceSelection: true,
mode:'local',
name: "combo_name"
}
]
}
// now i have a button which submits the data
function submit() {
var form=Ext.getCmp('my-form').getForm();
form.api.submit(form.getValues(), {
method:'POST',
success: function(form,action) {...},
failure: function(form, action) {...}
});
}
if i check the received data on my server i get allways the displayField value not the valueField value.
everything should be fine, because if i call in the submit function
Ext.getCmp('my-combo').getValue();
i get the valueField value as expected.
if i am doing something wrong please help.
by the way, i am using ExtJS 3.2.1
Here is my simplified code
var myData = new Ext.data.DirectStore({
directFn:Server.getData,
reader: new Ext.data.JsonReader(
{root: 'data', totalProperty: 'total'},
[
{name: 'ID',type: 'int'},
{name: 'name', type: 'string'}
]
),
sortInfo: {field: 'name', direction: "ASC"},
remoteSort:true
});
// only the config of my form for simplicity
{xtype:"form", id:"my-form", methode:"post", title:"Details",
api: {load: Server.load,submit: Server.update},
items: [
{xtype: "combo",
id:"my-combo",
store: myData,
valueField: 'ID',
displayField: 'name',
forceSelection: true,
mode:'local',
name: "combo_name"
}
]
}
// now i have a button which submits the data
function submit() {
var form=Ext.getCmp('my-form').getForm();
form.api.submit(form.getValues(), {
method:'POST',
success: function(form,action) {...},
failure: function(form, action) {...}
});
}
if i check the received data on my server i get allways the displayField value not the valueField value.
everything should be fine, because if i call in the submit function
Ext.getCmp('my-combo').getValue();
i get the valueField value as expected.
if i am doing something wrong please help.
by the way, i am using ExtJS 3.2.1