I am working w/ Ext 3.3
How can I do conditional value checking, on the Ext.data package level, like;
if the person is married, require spouse name, otherwise let it be blank.
The solution I am looking for should be on the data package. (lets say that I dont have much control about how data is edited, but I am responsible for validating it.)
Ext.Data.Field lets me say allowBlank, true or false. I wonder if I can pass a function there which accepts the record, and returns true or false based on the other fields on the record.
I am looking for an alternative solutions for this, on the Ext.data package, (on the Store or Record level).
It depends on when you are doing the validation.
If you are validating when
store.load();is invoked, then I suggest the following:If you are validating whenever data changes in the store, then use the following:
Here’s what it means to be falsey.