Make custom validation rule application-wide

Hi,
I use Webix Jet and have my own validation rules.
I want to define them in one place and use in any page/view.
How to do that?

  • create a separate module
  • add new rules to webix.rules
webix.rules.myrule = function(a){ return some(a); };
  • require this module in app.js

Any extension which you are adding to webix can be included only once, to be available in all views. ( from code readability point of view, it may have sense to include such extension only in views where it will be used, such approach will work the same as including the module once )