ExtJS textfield validation — too much recursion


ExtJS textfield validation was returning error “too much recursion” when I was trying to add a listener in the text field. After digging into my code I saw following piece of code:

TextField listener

listeners : {
valid : validateAddDoctorForm
}

and

Listener method description:

var validateAddDoctorForm = function() {
var saveButton = Ext.getCmp('save_doctor_button');
if ( createDoctorPanel.getForm().isValid() === false ) {
saveButton.disable();
} else {
saveButton.enable();
}
};

Apparently, using valid or invalid events with isValid function of the form seem to cause infinite recursion. Hence, if at all you have to enable or disable any button based on validity of a certain field using “valid” or “invalid” event, make sure you don’t check validity of complete form all over again.

Tagged with: , , ,
Posted in Sencha ExtJS
One comment on “ExtJS textfield validation — too much recursion
  1. […] set to true in the TextField config. and if you are optimistic enough then you can also think about valid and invalid […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Do More. With Sencha.

Recent Publication
%d bloggers like this: