I’m having trouble attaching a form to my layout. A simplified version of my code is something like this:
[code]dhxLayout = new dhtmlXLayoutObject(document.body, “1C”);
tabbar = dhxLayout.cells(“a”).attachTabbar(“left”);
tabbar.addTab(“a1”,“Tab 1”,"*");
//Layout
layout1=tabbar.cells("a1").attachLayout("2U");
//Grid
grid1 = layout1.cells("a").attachGrid();
//Form
var form1
formData
function doOnLoad() {
formData = [{
type: "settings",
position: "label-left",
labelWidth: 130,
inputWidth: 120
}, {
type: "fieldset",
label: "Welcome",
inputWidth: "auto",
list: [{
type: "radio",
name: "type",
label: "Already have account",
labelWidth: "auto",
position: "label-right",
checked: true,
list: [{
type: "input",
label: "Login",
value: "p_rossi"
}, {
type: "password",
label: "Password",
value: "123"
}, {
type: "checkbox",
label: "Remember me",
checked: true
}]
}, {
type: "radio",
name: "type",
label: "Not registered yet",
labelWidth: "auto",
position: "label-right",
list: [{
type: "input",
label: "Full Name",
value: "Patricia D. Rossi"
}, {
type: "input",
label: "E-mail Address",
value: "p_rossi@example.com"
}, {
type: "input",
label: "Login",
value: "p_rossi"
}, {
type: "password",
label: "Password",
value: "123"
}, {
type: "password",
label: "Confirm Password",
value: "123"
}, {
type: "checkbox",
label: "Subscribe on news"
}]
}, {
type: "radio",
name: "type",
label: "Guest login",
labelWidth: "auto",
position: "label-right",
list: [{
type: "select",
label: "Account type",
options: [{
text: "Admin",
value: "admin"
}, {
text: "Organiser",
value: "org"
}, {
text: "Power User",
value: "poweruser"
}, {
text: "User",
value: "user"
}]
}, {
type: "checkbox",
label: "Show logs window"
}]
}, {
type: "button",
value: "Proceed"
}]
}];
}
form1 = layout1.cells("b").attachForm();
form1.loadStruct(formData, "json");[/code]
The json code is copied from this sample dhtmlx.com/docs/products/dht … bject.html, so I really don’t understand why it’s not working for me…but I’ve never used json before so maybe I’m missing something obvious.
Any help is appreciated.