PDA

View Full Version : [CLOSED-449][2.x,3.x] ComboBox.setValue(null)



Condor
14 Dec 2009, 7:17 AM
Setting the value of a combobox with a hiddenName to null will make the value 'null' (literal text) instead of ''.

Suggested patch:

Ext.override(Ext.form.ComboBox, {
initValue : function(){
Ext.form.ComboBox.superclass.initValue.call(this);
if(this.hiddenField){
this.hiddenField.value =
Ext.value(Ext.isDefined(this.hiddenValue) ? this.hiddenValue : this.value, '');
}
},
setValue : function(v){
var text = v;
if(this.valueField){
var r = this.findRecord(this.valueField, v);
if(r){
text = r.data[this.displayField];
}else if(Ext.isDefined(this.valueNotFoundText)){
text = this.valueNotFoundText;
}
}
this.lastSelectionText = text;
if(this.hiddenField){
this.hiddenField.value = Ext.value(v, '');
}
Ext.form.ComboBox.superclass.setValue.call(this, text);
this.value = v;
return this;
}
});

Condor
19 Jan 2010, 4:02 AM
*** Bump ***

Jamie Avins
19 Jan 2010, 3:42 PM
Applied in svn 5921