cgp
15 Jun 2007, 6:40 AM
When creating a combo box on the fly (not transforming):
There is some code which hiccups while trying to set the initial value (and thereby setting the selected item) using the setValue method on the combo box:
The code is at roughly line 200 of the TextField.js source file (under forms).
I think this code is expecting the combo box to be tied to some sort of element, which it is not, so it hiccups.
setValue : function(v){
if(this.emptyText && v !== undefined && v !== null && v !== ''){
this.el.removeClass(this.emptyClass);
}
Ext.form.TextField.superclass.setValue.apply(this, arguments);
},
By putting in the test for the element, the function continues and all is happy again.
setValue : function(v){
if(this.emptyText && this.el && v !== undefined && v !== null && v !== ''){
this.el.removeClass(this.emptyClass);
}
Ext.form.TextField.superclass.setValue.apply(this, arguments);
},
Thanks. Not sure if this is the "right" fix, but it worked for me, so it is what I am using now.
There is some code which hiccups while trying to set the initial value (and thereby setting the selected item) using the setValue method on the combo box:
The code is at roughly line 200 of the TextField.js source file (under forms).
I think this code is expecting the combo box to be tied to some sort of element, which it is not, so it hiccups.
setValue : function(v){
if(this.emptyText && v !== undefined && v !== null && v !== ''){
this.el.removeClass(this.emptyClass);
}
Ext.form.TextField.superclass.setValue.apply(this, arguments);
},
By putting in the test for the element, the function continues and all is happy again.
setValue : function(v){
if(this.emptyText && this.el && v !== undefined && v !== null && v !== ''){
this.el.removeClass(this.emptyClass);
}
Ext.form.TextField.superclass.setValue.apply(this, arguments);
},
Thanks. Not sure if this is the "right" fix, but it worked for me, so it is what I am using now.