PDA

View Full Version : Issue with displayField and valueField in combo remote store



sanova
24 Nov 2012, 2:13 AM
Hi,
i have some issue submitting the value of combo with a remote store loaded.
It's all ok but when i submit form the value returned from combo is displayField and not valueField.

I red something on the net but not a clear solution.

Is there a solution to solve that problem?

Here the combo code:



{
xtype: 'combo',
id: 'cod_FMC',
name: 'cod_id',
fieldLabel: 'Cod.',
store: comboStoreCod,
typeAhead: false,
forceSelection: true,
triggerAction: 'all',
emptyText:'Select one.. ',
queryMode: 'remote',
displayField:'cod_desc',
valueField:'cod',
allowBlank: false,
hideTrigger:false,
blankText: '...',
selectOnFocus: true
}



Here the store code:



var comboStoreCod = new Ext.data.JsonStore ({
autoload: true,
id: 'comboStoreCodiceVia',
root: 'rows',
fields: [{
name: 'cod',
mapping:'cod'
},{
name: 'cod_desc',
mapping:'cod_desc'
}],

url: 'web-service/path/to/store/store.php',
method: 'GET'
});

comboStoreCodiceVia.load();

mitchellsimoens
26 Nov 2012, 8:13 AM
Have you tried using the hiddenName?

willigogs
27 Nov 2012, 7:45 AM
This might help:
http://www.sencha.com/forum/showthread.php?95111-RowEditor-ComboBox-on-update-showing-value-instead-of-display&p=458355&viewfull=1#post458355