PDA

View Full Version : Combo box validator and Display value vs value



stimpy
27 Jun 2012, 7:31 AM
I have a combo box



xtype:'combobox',
name:'myExampleName',
id:'myExampleId',
displayField:'dips',
valueField:'val',
validator: function(value){
console.log(value);
}


This outputs the displayField value NOT the value field value .

If the name id of the object is "myExampleId" and I do this


var myTestObject= Ext.getCmp(myExampleId);
console.log(myTestObject.getValue());


I get the valueField value as expected.

Can anyone explain why ? Validator seems to acting wrongly .

stimpy
28 Jun 2012, 4:51 AM
I still cannot seem to explain this .
Anyone have a clue ?
Am I using the validator incorrectly?

lanbo
22 Nov 2012, 10:21 AM
There must be a bug. I get the same behavior in extjs 3.4
Documentation specifies that the validator function should give the value as parameter.