I'm learning ExtJS, and I came across two different concepts, that seem logically connected to me.
My question is:
Thanks
As Molecule Man says, there is no built-in functionality for this, however...
This seems to be a commonly required feature (and something that makes Ext JS 4 look a little half-baked), and other people have come up with various solutions:
The first suggestion modifies the Ext.form.field.Base class to allow binding a form field to a Model field, and to validate the form field against validations defined on the form field as well as those defined on the bound Model field.
I'm just about to test the first suggestion, may post an update on how it goes...
1.
Is it possible to have the form use the model's validation setup to validate what the user enters and show realtime feedback?
There is no built-in functionality for model's realtime validating. However, there is better way then using model's validation.
2.
If the answer to 1 is No, then is there any other way to set up realtime validation in the form?
Yes, there is.
Form's fields support vtype
config (More info can be found here). By default the fields would be validated everytime the fields' value would change (if you want to turn off this behaviour set field's validateOnChange
config to false).
Check out docs (the Validation
section and the Example usage
section) for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With