Validation Suggestions

The system design for validating a form component is very nice. Here are a couple of ideas to consider to enhance it:

  • Currently the $all edit rule only is called when there is a specific rule for a field. Not sure if that is on purpose or a defect. The example for $all edit rule in the Validating Data with DHTMLX Touch documentation will be never called on any field. (see lines starting around 6601 in debug source.)

  • Currently, the special evaluation key $obj is evaluated before any other rules. It might be useful to evaluate all the other rules before calling the $obj rule. That way simple rules like isNotEmpty can be done before the $obj rule.

Thanks,
Kris

Currently the $all edit rule only is called when there is a specific rule for a field. Not sure if that is on purpose or a defect.

Actually a defect, will be fixed.

It might be useful to evaluate all the other rules
Not quite sure that order is matter, but existing behavior, when $obj rule prevents separate rules check is definitely not good and will be fixed ( both $obj and separate validation rules will be checked during validation call )

Both fixes will be included in the next update