PDA

View Full Version : ComboBox disable text entry solution



vtswingkid
4 May 2007, 5:05 AM
First off, if there is alreay a way to disable text entry please inform me.

If not could we please add this or something similar to the code.



Ext.form.ComboBox.prototype.fireKey=function(e){
if(e.isNavKeyPress() && !this.list.isVisible()){
this.fireEvent("specialkey", this, e);
}
if(this.noType)e.stopEvent();
};

vtswingkid
4 May 2007, 5:11 AM
Silly me I suppose I could have just used maskRe.

Still is there a better way? Maybe a way with out focus to the textbox itself while the combo still functions properly?

manugoel2003
4 May 2007, 5:18 AM
I guess you can use editable config option and set it to false to prevent text input. Alternatively you can use setEditable() method at run-time for the same effect. I hope this solves the problem.

vtswingkid
4 May 2007, 5:33 AM
Thanks!

I must be getting tired. Overlooked this I don't know how many times.



editable:Boolean
False to prevent the user from typing text directly into the field, just like a traditional select (defaults to true)

manugoel2003
4 May 2007, 8:04 AM
happens to me all the time :)