PDA

View Full Version : How to change widgets dynamically



JJDoneAway
30 May 2010, 12:53 AM
Hi,

at the moment I implement a quite complex form which changes its widgets dynamically. So for example if you select a certain value out of a combo box a text field should vanish and on its position should appear a check box. I did this behaviour by firing and consuming events. Now I got the problem that the form behalves sometimes a bit strange with the Firefox and the IE isn't even able to open the whole form. (In fact I think that I'm lost in events)

As I'm very new to ExtJs I'm a bit uncertain which pattern I should use for this dynamic stuff.

Call the functions direct which do than something like
Ext.getCmp('foo-form-panel').remove(Ext.getCmp('foo'));
Ext.getCmp('foo-form-panle').add(new Ext.form.CheckBox(...));

Or fire events?

I would be glad if you could name some articles about a best practice of doing this things

Thx