PDA

View Full Version : textfield formatting



avsomeren
22 Aug 2009, 10:49 AM
Hi all,

I'm trying to figure out if it's possible to format a textfield's contents while using the getForm().load method that loads data into my form fields.

Anyone have a solution?

best regards,
avsomeren

Animal
22 Aug 2009, 11:32 PM
Do you mean preprocess the values before loading them into the form?

I agree that this is a very common requirement, and I have been bothering the dev team for a couple of years to add a new event so we can get in there easily.

I use this to add a beforesetvalues event to BasicForm



Ext.override(Ext.form.BasicForm, {
setValues: Ext.form.BasicForm.prototype.setValues.createInterceptor(function(values){
return this.fireEvent('beforesetvalues, this, values);
});
});


Why they don't add it I do not know.

avsomeren
22 Aug 2009, 11:46 PM
This is brilliant, i could have thought of this myself... But since Ext provides soo many functionalities, sometimes you can't see the forest through the trees ;)

Thank you for helping me out again, and for providing great support for the community.