-
2 Apr 2012 12:47 AM #1
A question about validation (in a MVC architecture)
A question about validation (in a MVC architecture)
Hi!
Sorry for posting this two times, but I'm very interested in your opinions (I'm a newbie).
I'm developing a new site and I would like to use ExtJS 4 in a MVC architecture (described in the guides of this site). This site has a lot of dialogs (basically windows elements with forms) and controllers.
I would like to ask you where you would insert form validation of all those dialogs?
In the controllers? In the windows (views)? Consider that I call those dialogs from different controllers.
Thank you very much in advance for any advice!
David
-
2 Apr 2012 1:43 AM #2
Simple rules:
i usually put into my forms.Code:allowBlank: false, vtype: 'email'
and verify it in my controller:
Demo here http://ext4all.com/post/extjs-4-mvc-...n-architectureCode:if (form.getForm().isValid()) { store.add(values); win.close(); }
-
2 Apr 2012 6:06 AM #3


Reply With Quote