Hi,
Is there a way to check user modification of widget values?
I need to highlight widgets with modified values.
What is best practice/recommendation for such task?
You can put controls into a form, and then add CSS with the onChange
event for each element via elementsConfig
:
OK, thanks!
Can I use onAfterValidation instead of onChange?
I need to color widget depending on validation result, red or green.
I tried to change one handler to another but it doesn’t work:
http://webix.com/snippet/49f3ba09
The onAfterValidation
event is triggered for a form, not each of its elements.
There’s a better scenario for per-item validation. Please, check: http://webix.com/snippet/371f07b1
Also please note that invalid elements are colored red by default after validation is complete. So you needn’t apply specific CSS to them.
Thanks a lot!
validate:webix.rules.isEmail
by the way, webix validation rules for email have the small error - a space is considered a valid symbol. This is not true.
Therefore, the email expression " @ . " wrongly considered valid.
One note:
We need a call to removeCss(“green”) first, or node class can become “green green green green” after multiple changes.
Even if validation fails at the last change.
I need to enable/disable some buttons depend on ui.text elements validation.
If element is changed and valid then button should be enabled and disabled if result of validation is negative.
But if I change only one text field it need to lost focus to be validated.
Is there any possibility to check changes like this: http://webix.com/snippet/371f07b1
but additionally check changes of ui.text elements on stop editing?