When creating a form using the documented attachForm() method like so:
var myForm = tab.attachForm(jsonFormData);
The addItem() method does not seem to work.
myForm.addItem(null, jsonItemData, 0);
Uncaught TypeError: Object # has no method ‘addItem’
Other methods like .clear() don’t seem to give a problem.
Am I using this wrong?
-edit-
I figured out there’s a function called _addItem() (starting with underscore).
But it gives us a new error:
Uncaught TypeError: Cannot read property ‘_index’ of undefined dhtmlx.js:473
_addItem
Darya
October 15, 2013, 3:38pm
#4
Method addItem needs an extention dhtmlxform_dyn.js
Have you include it in the library?
No, but I am not using the separate form element either.
I am using dhtmlx_std_full 3.6 for development, it includes everything, right?
Darya
October 17, 2013, 11:45am
#6
Unfortunatelly, file dhtmlxform_dyn.js wasn’t included in a standard version of dhtmlx.js
We will fix it in the next build.
You can use separate files, add all the form files after compilled one or recompile the whole library manually
Thanks. Can’t just include dhtmlxform_dyn.js ? The rest of the form functionality seems to work.
Darya
October 18, 2013, 8:18am
#8
If everything works fine - you can just include an extention.
If some issues arise, will include all form js files.