load grid Structure from JSON

hi :slight_smile:
how i can load grid structure from a Json?
I have attached a grid to a cell layout and now i am passing this json

[code]{
columns:[
{
label: “a”,
width: 25,
type: “ed”
},
{
label: “b”,
width: 25,
type: “ed”
},
{
label: “c”,
width: 25,
type: “ed”
},
{
label: “d”,
width: 25,
type: “ed”
}
],
rows:[
{ id:1,
selected:true, // select row
data:[
“a”,
“b”,
“c”,
“d”
]
}
]

}[/code]
to the parse command, but i receive this error:TypeError: this.obj.firstChild is null http://localhost:8080/myapp/js/dhtmlx/dhtmlx_suite/dhtmlx.js Line 6806

Thank you.

Jacopo

Unfortunately such init from json is not available in case of attaching the grid to layout/tabbar/…

Hi

FYI:
Initializing the Grid with an XML snippet enables you to use load with json.

xmls = ‘<?xml version="1.0" encoding="UTF-8"?>…’;
dhxGrid.parse(xmls, “xml”);
dhxGrid.clearAndLoad("/data.json", “json”);

Cheers