andrei.neculau
4 Aug 2007, 5:42 AM
I was looking at all the ClearableComboBox and all the twin triggers, and such.. but why shouldn't the combobox be cleared out simply by deleting the text?!
When you have forseSelection:true, and you delete the inner text, then the combobox will go with the previous selection.
Here's a "fix":
Ext.apply(Ext.form.ComboBox, {
doForce : function(){
if(this.el.dom.value.length > 0){
if (this.el.dom.value == this.emptyText) {
this.clearValue();
}
else {
this.el.dom.value =
this.lastSelectionText === undefined ? '' : this.lastSelectionText;
this.applyEmptyText();
}
}
}
});
When you have forseSelection:true, and you delete the inner text, then the combobox will go with the previous selection.
Here's a "fix":
Ext.apply(Ext.form.ComboBox, {
doForce : function(){
if(this.el.dom.value.length > 0){
if (this.el.dom.value == this.emptyText) {
this.clearValue();
}
else {
this.el.dom.value =
this.lastSelectionText === undefined ? '' : this.lastSelectionText;
this.applyEmptyText();
}
}
}
});