PDA

View Full Version : Change event on form



devtig
1 Sep 2010, 3:37 AM
I'd like to listen to my form to know if any field has changed, but I can't find a change event on form. I can listen to clientValidation, but that doesn't tell me if a value has changed (not without comparing hashes of getValues() or something). Don't want to iterate through all fields applying a listener to a change event either. (I've looked through the forums, but couldn't find nothing. Did find http://hutten.org/bill/extjs/2009/11/enabling-event-bubbling-for-al.html )

Animal
1 Sep 2010, 4:24 AM
Ext.form.Field.prototype.initComponent = Ext.form.Field.prototype.initComponent.createSequence(function() {
this.enableBubble('change');
});


Then listen for change on the FormPanel (or, in fact on any ancestor Container)

devtig
1 Sep 2010, 4:30 AM
Thanks man. That goes into my ExtOverrides.js.