attachForm() to layout and loadstruct()

Hi,

I tried to use the following example:

myForm = mylayout.cells("a").attachForm(); myForm.loadStruct("data.json", "json");

The example was mentioned here: docs.dhtmlx.com/doku.php?id=dhtm … ntegration

Unfortunatly I receive the following error:
in FF: mylayout.cells(“a”).attachForm is not a function
in IE: Object doesn’t support this property or method.

It works fine when using a tabbar, but not on a layout.

I included the dhtmlxcommon.js, dhtmlxcontainer.js, dhtmlxlayout.js and dhtmlxform.js

I couldn’t find the function in the documentation under the layout api methods. So I’m a bit confused if this function is actually supported as described in the earlier example.

can you confirm if it is supported or not and if it is, what I’m doing wrong?

kind regards,
Arno Vanbeginne
Xenon54.

Hello,

probably you did not included dhtmlxform.js

Please have a look at the working sample in the Suite package

dhtmlxSuite/dhtmlxForm/samples/05_integration/02_layout.html

Hi,

I did not forget to include dhtmlxform.js.
I’m also aware of the example you mention, but it is not useful to me.
In your example you set the structure in a variable on the page, I need the structure to be loaded from xml or json as is seen in a code-example at the bottom of this page: docs.dhtmlx.com/doku.php?id=dhtm … ntegration

With a layout-cell this produces an error. With a window-cell or a tabbar-cell this works.

kind regards,
Arno Vanbeginne
Xenon54.

Hi,

are you using 3.0 version ? Please attach the complete demo if the problem reproduces in the latest (3.0) version

Hi,

I also have this problem … I have been using form and layout since a while and didn’t have this issue … It seems to be a new issue from V3.0.

I’m using dhtmlxform from V3.0 Professionnal.

My apologize, i was importing dhtmlxcommon.js twice … And the second import was after dhtmlxform.js

Nice timing on this. I had the exact same problem and found that the order of JS files appears to be relevant. I was banging my head on the ‘mylayout.cells(“a”).attachForm is not a function’ error until, after reading this thread, I tinkered with the order of the JS files. What ended up working for me was:

[]dhtmlxcommon.js[/]
[]dhtmlxcontainer.js[/]
[]dhtmlxlayout.js[/]
[]dhtmlxform.js[/]

My original order had form above layout and container.