PDA

View Full Version : FormPanel 'change' event missing



fermo111
13 Aug 2009, 5:54 AM
I think it would be handy to have a 'change' event fired by the FormPanel, but I couldn't find one.

Has anybody developed an extension to do it?

There is a 'clientvalidation' event, that I have used so far, but I find it somewhat awkward to use. And I really don't understand the rationale behind it.

Is there any plan to add a 'change' event?

Thanks.

Luca

Animal
13 Aug 2009, 6:01 AM
You mean receive bubbled change events from its Fields?

fermo111
13 Aug 2009, 6:25 AM
Hi Animal

I think so.

I am right now using your solution explained in http://extjs.com/forum/showthread.php?p=208780#post208780

But there are some components that fire the 'change' event in some different way, like the Ext.form.RadioGroup, that must be taken care of.

Thanks

Luca

Animal
13 Aug 2009, 6:34 AM
You don't need that in Ext 3.0

Events can be made to bubble.

Just add



Ext.form.Field.prototype.initComponent = Ext.form.Field.prototype.initComponent.createSequence(function() {
this.enableBubble('change');
});


At the top of your app, and the change event will bubble up the ownerCt hierarchy.

NB: That is to the FormPanel, not the BasicForm

fermo111
13 Aug 2009, 6:50 AM
Wow! Great. Thanks a lot!