load a form

Hello.
I need to dynamically load a form, not only data but the whole structure. This was working in version 0.8 but it doesn’t anymore.
In my layout I have:

view:'form', id:'zeform', elements:[],url:''

later I have

$$("datalist").attachEvent("onselectchange", function fllfrm (id){ var obj = $$("datalist").item(id); a= "./data/..."; $$('zeform').load(a); });

data is something like this:

{view:"text",label:"text", align:"left"}

This gives no error but nothing loads in my form, call to file is done.
In documention I find:

debugging I found out that it doesn’t actually read my json data as form configuration but as plain data. Seems like it does a setValues instead of load (or parse, I also tried it but no difference)

can you help me out?

In latest version form is just a container for input controls, so it can’t load configuration.
But there is a workaround

you can use

dhx.ajax("config.json", function(text){ var obj = dhx.DataDriver.json.toObject(text); dhx.ui(obj, id_of_form); });

it will create new ui inputs based on provided configuration and will place them in the target form.

Great! It works! Thanks

Just one thing, I had to change id_of_form in $$(“id_of_form”)

dhx.ajax(a, function(text){ var frm = dhx.DataDriver.json.toObject(text); dhx.ui(frm, $$("id_of_form")); });