The problem arises when you attempt to attach a grid and load data via a php (with xml output) inside of another element.
For example, if I attach a grid to a layout cell and use the load() function, it will Max out. If I attach a URL to that same layout cell with an html file and attach the grid to a
the load() function works perfectly.
I’m running into the same issue with attaching a grid to a window. It maxes out.
[code]dhxLayout = new dhtmlXLayoutObject({
parent: document.body, // id/object, parent container where the layout will be located
pattern: "2U", // string, layout's pattern
skin: "dhx_terrace", // string, optional, "dhx_skyblue", "dhx_web", "dhx_terrace"
cells: [ // optional, cells configuration according to the pattern
// you can specify only the cells you want to configure
// all params are optional
{
id: "a", // id of the cell you want to configure
header: false, // hide header on init
width: 190, // cell init width
},
{
id: "b", // id of the cell you want to configure
header: false, // hide header on init
}
]
});
dhxLayout.attachHeader("header");
dhxLayout.attachFooter("footer");
addUsersToGroupUpperForm = [
{type:“settings”, position:“label-left”, labelWidth: “60”, inputWidth: “200”, noteWidth: “100” },
{type: “block”, width: “auto”, list:[
{type: “block”, width: “auto”, list:[
{type: “input”, name: “search”, label: “Search:” },
{type: “newcolumn”, offset: 10},
{type: “button”, name:“goSearch”, value:“Search”},
{type: “newcolumn”, offset: 10},
{type: “button”, name:“clearSearch”, value:“Clear Search”},
{type: “newcolumn”, offset: 10},
{type: “button”, name:“fullCardView”, value:“Full Card View”},
{type: “newcolumn”, offset: 10},
{type: “button”, name:“printRoster”, value:“Print Roster”},
]},
{type: “block”, width: “auto”, list:[
{type: “select”, name: “grade”, label: “Grade:”, connector: “grade.php?type=all”, value: “”},
{type: “newcolumn”, offset: 10},
{type: “block”, width: “auto”, list:[
{type: “radio”, label: “Male”, name: “gender”, value: “M”, labelWidth: “50”, inputWidth: “30”, position:“label-right”},
{type: “newcolumn”, offset: 10},
{type: “radio”, label: “Female”, name: “gender”, value: “F”, labelWidth: “50”, inputWidth: “30”, position:“label-right”},
{type: “newcolumn”, offset: 20},
{type: “radio”, label: “Students”, name: “status”, value: “student”, labelWidth: “50”, inputWidth: “30”, position:“label-right”},
{type: “newcolumn”, offset: 10},
{type: “radio”, label: “Adults”, name: “status”, value: “adult”, labelWidth: “50”, inputWidth: “30”, position:“label-right”},
]}
]},
{type: "newcolumn", offset: 175},
{type: "button", name:"saveGroup", value:"Save"},
{type: "newcolumn", offset: 45},
{type: "button", name:"cancel", value:"Cancel"},
]}
];
addUsers = dhxLayout.cells(“b”).attachLayout({
//parent: "", // id/object, parent container where the layout will be located
pattern: "3T", // string, layout's pattern
skin: "dhx_terrace", // string, optional, "dhx_skyblue", "dhx_web", "dhx_terrace"
cells: [ // optional, cells configuration according to the pattern
// you can specify only the cells you want to configure
// all params are optional
{
id: "a", // id of the cell you want to configure
header: false, // hide header on init
height: 80,
},
{
id: "b", // id of the cell you want to configure
header: false, // hide header on init
width: 700, // cell init width
height: "100%"
},
{
id: "c", // id of the cell you want to configure
header: false, // hide header on init
}
]
});
addUsersForm = addUsers.cells("a").attachForm(addUsersToGroupUpperForm);
rosterView = addUsers.cells("b").attachDataView(dv_rosterList);
rosterView.load("loadEventRoster.php?id="+eventID);
groupView = addUsers.cells("c").attachDataView(dv_rosterList);
groupView.load("loadEventGroup.php?id="+eventID);
addUsersForm.attachEvent("onButtonClick", function(id) {
if (id == "printRoster") {
var dhxWins = new dhtmlXWindows("terrace");
dhxWins.createWindow("eventRoster", 500, 175, 650, 325);
dhxWins.window("eventRoster").setText("Event Roster");
ERgrid = dhxWins.window("eventRoster").attachGrid();
ERgrid.setImagePath("../codebase.412/sources/dhtmlxGrid/codebase/imgs/dhxgrid_terrace"); //the path to images required by grid
ERgrid.setHeader("#, Last Name, First Name, Gender");//the headers of columns
ERgrid.setColumnIds("num,last_name,first_name,gender");
ERgrid.setInitWidths("75,200,200,100"); //the widths of columns
ERgrid.setColAlign("left,left,left,left"); //the alignment of columns
ERgrid.setColTypes("ed,ed,ed,ed"); //the types of columns
ERgrid.setColSorting("int,str,str,str"); //the sorting types
ERgrid.init(); //finishes initialization and renders the grid on the page
ERgrid.load("loadRosterGrid.php?id="+eventID);
}
});
[/code]
Here is the XML of the data to fill the grid.
<?xml version='1.0' encoding='utf-8' ?><rows><row id='262'><cell><![CDATA[1]]></cell><cell><![CDATA[Barr]]></cell><cell><![CDATA[Jackson]]></cell><cell><![CDATA[M]]></cell></row>
<row id='254'><cell><![CDATA[2]]></cell><cell><![CDATA[Bedgood]]></cell><cell><![CDATA[Crystal]]></cell><cell><![CDATA[F]]></cell></row>
<row id='253'><cell><![CDATA[3]]></cell><cell><![CDATA[Bedgood]]></cell><cell><![CDATA[Payton]]></cell><cell><![CDATA[M]]></cell></row>
<row id='250'><cell><![CDATA[4]]></cell><cell><![CDATA[call]]></cell><cell><![CDATA[chandler]]></cell><cell><![CDATA[F]]></cell></row>
<row id='249'><cell><![CDATA[5]]></cell><cell><![CDATA[call]]></cell><cell><![CDATA[sarah kate ]]></cell><cell><![CDATA[F]]></cell></row>
<row id='246'><cell><![CDATA[6]]></cell><cell><![CDATA[DeMersseman]]></cell><cell><![CDATA[Jake]]></cell><cell><![CDATA[M]]></cell></row>
<row id='245'><cell><![CDATA[7]]></cell><cell><![CDATA[DeMersseman]]></cell><cell><![CDATA[Zachary]]></cell><cell><![CDATA[M]]></cell></row>
<row id='255'><cell><![CDATA[8]]></cell><cell><![CDATA[Folsom]]></cell><cell><![CDATA[Madison]]></cell><cell><![CDATA[F]]></cell></row>
<row id='277'><cell><![CDATA[9]]></cell><cell><![CDATA[Hall]]></cell><cell><![CDATA[Georgia ]]></cell><cell><![CDATA[F]]></cell></row>
<row id='251'><cell><![CDATA[10]]></cell><cell><![CDATA[Hall]]></cell><cell><![CDATA[Gracie ]]></cell><cell><![CDATA[F]]></cell></row>
<row id='259'><cell><![CDATA[11]]></cell><cell><![CDATA[Holley]]></cell><cell><![CDATA[Carter]]></cell><cell><![CDATA[M]]></cell></row>
<row id='242'><cell><![CDATA[12]]></cell><cell><![CDATA[Irwin]]></cell><cell><![CDATA[Casey]]></cell><cell><![CDATA[F]]></cell></row>
<row id='264'><cell><![CDATA[13]]></cell><cell><![CDATA[Loughran]]></cell><cell><![CDATA[Patrick]]></cell><cell><![CDATA[M]]></cell></row>
<row id='241'><cell><![CDATA[14]]></cell><cell><![CDATA[Pickard]]></cell><cell><![CDATA[Brant]]></cell><cell><![CDATA[M]]></cell></row>
<row id='256'><cell><![CDATA[15]]></cell><cell><![CDATA[Posse]]></cell><cell><![CDATA[Madeline]]></cell><cell><![CDATA[F]]></cell></row>
<row id='270'><cell><![CDATA[16]]></cell><cell><![CDATA[Sanderlin]]></cell><cell><![CDATA[Gracyn]]></cell><cell><![CDATA[F]]></cell></row>
<row id='271'><cell><![CDATA[17]]></cell><cell><![CDATA[Sanderlin]]></cell><cell><![CDATA[Taylor]]></cell><cell><![CDATA[F]]></cell></row>
<row id='280'><cell><![CDATA[18]]></cell><cell><![CDATA[Steedley]]></cell><cell><![CDATA[Sage]]></cell><cell><![CDATA[F]]></cell></row>
<row id='281'><cell><![CDATA[19]]></cell><cell><![CDATA[Taylor]]></cell><cell><![CDATA[Cami]]></cell><cell><![CDATA[F]]></cell></row>
<row id='258'><cell><![CDATA[20]]></cell><cell><![CDATA[Thigpen]]></cell><cell><![CDATA[Coston]]></cell><cell><![CDATA[M]]></cell></row>
<row id='260'><cell><![CDATA[21]]></cell><cell><![CDATA[Thornton]]></cell><cell><![CDATA[Beth-Anne]]></cell><cell><![CDATA[F]]></cell></row>
<row id='261'><cell><![CDATA[22]]></cell><cell><![CDATA[Thornton]]></cell><cell><![CDATA[Emily]]></cell><cell><![CDATA[F]]></cell></row>
<row id='263'><cell><![CDATA[23]]></cell><cell><![CDATA[Wilson]]></cell><cell><![CDATA[Jack]]></cell><cell><![CDATA[M]]></cell></row>
</rows>