We had a dhtmlxGrid v.7.3.2 Professional and is covered by Enterprise License.
We configure the grid inside the layout but it failed to load grid and throw the error “Uncaught TypeError: dhx.Layout is not a constructor”. There is No Front-end Framework dependency in our project.
We did change in common samples file grid_initialization.html to create the attached sample example for reference. Please advice.
GridLayout.zip (483.5 KB)
Below is the simple sample code. Is anything missing here?
const layout = new dhx.Layout("grid", {
type: "space",
rows: [
{ id: "gridboxWrapper" }
]
});
const grid = new dhx.Grid(null, {
columns: [
{ width: 150, id: "country", header: [{ text: "Country" }] },
{ width: 150, id: "population", header: [{ text: "Population" }] },
{ width: 150, id: "yearlyChange", header: [{ text: "Yearly Change" }] },
{ width: 150, id: "netChange", header: [{ text: "Net Change" }] },
{ width: 150, id: "destiny", header: [{ text: "Density (P/Km²)" }] },
{ width: 150, id: "area", header: [{ text: "Land Area (Km²)" }] },
{ width: 150, id: "migrants", header: [{ text: "Migrants (net)" }] },
{ width: 150, id: "fert", header: [{ text: "Fert. Rate" }] },
{ width: 150, id: "age", header: [{ text: "Med. Age" }] },
{ width: 150, id: "urban", header: [{ text: "Urban Pop" }] }
],
data: dataset
});
layout.getCell("gridboxWrapper").attach(grid);