PDA

View Full Version : How to enable event bubbling for a Class?



ahartlen
3 Nov 2009, 4:49 AM
Say I have a FormPanel, and I want all fields on that FormPanel to bubble their 'change' event up to the form... How can I do this without having to call "enableBubble('change')" on each field?

There also doesn't seem to be any way of specifying bubbling behaviour in the config of a field, ie: "bubble: 'change'" or something like that?

Doing something like this:


Ext.form.Field.prototype.initComponent = Ext.form.Field.prototype.initComponent.createSequence(function() {
this.enableBubble('change');
});Seems ugly and intrusive - there must be a cleaner, class-specific way.