form submitting combobox proplem
I have a problem submiting a form with a combobox, because it is sending displayField instead of valueField, Funny thing is that if I manually check the value of the combobox component it has the right value.
Since this problem I have to send the form getting the values of the component mannually, wish works ok.
I give a few snippets of the code.
Thanks a lot in advance
Chelala
// The store for the combo
var respStore = new Ext.data.JsonStore( {
url : URL + '/optionsvc/responsibles',
root : 'responsibles',
id: 'ID',
fields : [ {
name : 'ID'
}, {
name : 'CARGO'
}]
});
// The combo added to the form
{
xtype : "combo",
store : respStore,
valueField : 'ID',
displayField : 'CARGO',
fieldLabel : "Responsable",
typeAhead : true,
mode: 'local',
loadingText : 'Cargando...',
emptyText : 'Especifique el cargo',
name : "RESP",
forceSelection : true,
allowBlank : false,
blankText : 'Campo requerido',
}
// the submiting handler
/*
HERE planForm.form.items.items[2].getValue() EQUALS to the right value
but on the params sent that field RESP is equals to the displayField
*/
planForm.form.submit( {
url : URL + '/optionsvc/edit/mode/' + mode,
waitMsg : 'Guardando datos...'
});
Thank you a lot, it's great to be helped so quick and accurate in this forum
bye, Chelala
{
xtype : "combo",
store : respStore,
valueField : 'ID',
displayField : 'CARGO',
hiddenName: 'combovalue',
fieldLabel : "Responsable",
typeAhead : true,
mode: 'local',
loadingText : 'Cargando...',
emptyText : 'Especifique el cargo',
name : "RESP",
forceSelection : true,
allowBlank : false,
blankText : 'Campo requerido',
}
#If you have any other info about this subject , Please add it free.# |