X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/f5240829880f87e0cf581c6a296e436fdef0ef80..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/src/widgets/form/Combo.js diff --git a/src/widgets/form/Combo.js b/src/widgets/form/Combo.js index 13baa539..51002710 100644 --- a/src/widgets/form/Combo.js +++ b/src/widgets/form/Combo.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.3.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.form.ComboBox @@ -935,10 +935,16 @@ myCombo.keyNav.tab = function() { // Override TAB handling function }, // private - assertValue : function(){ + assertValue : function(){ var val = this.getRawValue(), - rec = this.findRecord(this.displayField, val); + rec; + if(this.valueField && Ext.isDefined(this.value)){ + rec = this.findRecord(this.valueField, this.value); + } + if(!rec || rec.get(this.displayField) != val){ + rec = this.findRecord(this.displayField, val); + } if(!rec && this.forceSelection){ if(val.length > 0 && val != this.emptyText){ this.el.dom.value = Ext.value(this.lastSelectionText, ''); @@ -947,11 +953,11 @@ myCombo.keyNav.tab = function() { // Override TAB handling function this.clearValue(); } }else{ - if(rec){ + if(rec && this.valueField){ // onSelect may have already set the value and by doing so // set the display field properly. Let's not wipe out the // valueField here by just sending the displayField. - if (val == rec.get(this.displayField) && this.value == rec.get(this.valueField)){ + if (this.value == val){ return; } val = rec.get(this.valueField || this.displayField);