object define/reconstruct with rules of form

Hello ,
I use define and reconstruct methods with a form to create an object dynamically.

It is ok if I define rows of form :

object.define("rows",[{...},{...}]);
object.reconstruct();

Question : is it possible to do the same with rules ?

How to create something like that :

 rules: {
                name: function (value) {
                    return isvalidValue(value));
                },
                puk_code: function (value) {
                    if (value == "") return false;
                    var exp = new RegExp("^[0-9]{0,8}$", "g");
                    if (!exp.test(value)) return false;
                    return true;
                },
            },

Any ideas ?

Thanks

It is ok , I received data from JSON and I can reconstruct my rules , JSON from server is in variable params

example :

var rulesObj = {};
for (var p in params) {
   var name = params[p]['name'];
   if (params[p]['type'] == 'text') {
     rulesObj[name] = function (value) {
       return isValidName(value);
     }
  }
}                
object.define("rules", rulesObj);

As a suggestion, instead of

object.define("rows",[{...},{...}]);
object.reconstruct();

Please consider using one of common methods for layout rebuilding to avoid any issues, as in case of recreating layout, define is not the best way to do so. For example, check the following snippet:

https://webix.com/snippet/c291331d