Obtain the valueField from combo after to set displayValue?? EXTJS -
i have problem in getting number value combobox.
{ xtype: "combo", name: "cmb_scc", id: "cmb_scc", hiddenname: "combovalue", fieldlabel: "scc", width: 305, store: store_scc, valuefield: 'subcentro_codigo', displayfield: 'subcentro_nombre', triggeraction: 'all', disabled: true, mode: 'local', readonly: false, allowblank: false, listeners:{ select: function(combo, record, index) { ext.getcmp("cmb_scc").setvalue(record.get('subcentro_nombre')); } } },
in combobox have 2 values, valuefield
, displayfield
obtained store_scc. these values can example:
1 - engineering, 2 - humanity ... etc.
when click combo show name ( engineering) depends of number value (1).
this name showed when setvalue with:
ext.getcmp("cmb_scc").setvalue(record.get('subcentro_nombre'));
but line replaces original value 1 of 'cmb_scc' text engineering, if want obtain number value field after, not possible, can obtain number value if call getvalue
method before line.
example (subcentro = 1):
var subcentro = form_nuevocontrato.getform().findfield('cmb_scc').getvalue(); ext.getcmp("cmb_scc").setvalue(record.get('subcentro_nombre'));
example (subcentro = engineering)
ext.getcmp("cmb_scc").setvalue(record.get('subcentro_nombre')); var subcentro = form_nuevocontrato.getform().findfield('cmb_scc').getvalue();
how can obtain number value combo after setvalue in combo? need use in other statements later, fill grid depends of number value cmb_scc.
thanks!!!
Comments
Post a Comment