rule helper

Previous Next

Adds rule attributes to the element. At this moment only one attribute is supported: "*". The rule attributes are used by the field validation.

Iterates all attributes of a JSON control definition and adds rule attributes depending on whether a rule has been defined for that attribute in the factory definition:

$.udb.ui.registerControl("Control", null, {

 

 templateOptions: {

         data: {

                 rules: {

                         mandatory: function(value, options) {

                                 return (value ? {rule: "udb-mandatory", value: true} : undefined);

                         }

                 }

         }

 },

 

};

 

At this time, rule attributes are supported for mandatory, io-format, domain values and numeric values.