Is it possible to load the config scheme from json file as the columns, elements and rules?
You can use webix.ajax to load json and initialize views from callback:
Thank you again Maria, I have already used ajax and dinamic layout successfully.
this is an excerpt of json file:
{
“rules”:{
“name”:“isNotEmpty”
},
“elements”:[
{
“view”:“text”,
“name”:“ROWID”,
“label”:“Id”,
“width”:150,
“disabled”:true
},
…
and this is an excerpt of javascript:
var _f = $$('x_form’ + __j);
…
webix.ajax(“elements_” + __j + “.json”, {
success: function (text) {
var c = webix.DataDriver.json.toObject(text);
__f.define(“rules”, c.rules);
__f.config.elements = c.elements;
__f.reconstruct();
}
});
…
When I want to override the scheme, I can’t create a json file because scheme can contains functions and json syntax does not permits to encode functions.
I need to set the $init function for the forms children controls(which I load dynamically and anonymously), how can I address my need?