PDA

View Full Version : hiding and showing a combobox



snod0g
23 Apr 2007, 1:02 PM
i create my combobox inside of an
Ext.onReady( function () {


var combo = new ...


}


but when i try to do a combo.hidden=true; from inside one of my functions, it says undefined. so how can i make this combo globally accessible to my functions? thanks.

bendy
23 Apr 2007, 1:23 PM
If you want your combo box to be globally accesible you should do something like this:


window.combo = new Ext.form.ComboBox ....

Then you can hide it using


combo.hide();

and show using:


combo.show();

KimH
30 Apr 2007, 7:32 AM
bendy, this will probably not be a good solution because you will get a variable in the global namespace.

What you should try is to get to the combobox using its ID like:

Ext.get('ComboboxID').hide();