fredrik.stockel
29 Jun 2007, 2:15 AM
I'm using a Ext to generate a form with some fields. One field is of type comboBox and contains data from a SimpleStore (example below)
This is the setup for the field:
...
var projData = [
['T1', 'Test project 1'],
['T2', 'Test project 2']
];
var projStore = new Ext.data.SimpleStore({
data : projData,
fields: ['value', 'text']
});
form.column(
{width:282},
....
new Ext.form.ComboBox({
fieldLabel: Project,
name: 'projectId',
mode: 'local',
store: projStore,
valueField: 'value',
displayField: 'text',
typeAhead: true,
listAlign: 'tl-bl',
triggerAction: 'all',
emptyText: 'Select...',
width: 270,
forceSelection: true,
selectOnFocus:true,
allowBlank:false
})
);
...
My problem is that when I submit the form the displayField is sent to the server and not the valueField, If I understod the documentation correctly, the valueField should be the value submitted to the server and not the displayField (eg, projectId=T1)
anyone encountered something similar or know how to send the valueField instead of the displayField?
This is the setup for the field:
...
var projData = [
['T1', 'Test project 1'],
['T2', 'Test project 2']
];
var projStore = new Ext.data.SimpleStore({
data : projData,
fields: ['value', 'text']
});
form.column(
{width:282},
....
new Ext.form.ComboBox({
fieldLabel: Project,
name: 'projectId',
mode: 'local',
store: projStore,
valueField: 'value',
displayField: 'text',
typeAhead: true,
listAlign: 'tl-bl',
triggerAction: 'all',
emptyText: 'Select...',
width: 270,
forceSelection: true,
selectOnFocus:true,
allowBlank:false
})
);
...
My problem is that when I submit the form the displayField is sent to the server and not the valueField, If I understod the documentation correctly, the valueField should be the value submitted to the server and not the displayField (eg, projectId=T1)
anyone encountered something similar or know how to send the valueField instead of the displayField?