I am trying to use a Dojo dgrid inside a programmatically created Dojo Dialog using the following code:
define(["dojo/_base/declare","dgrid/Grid", "dijit/Dialog"], function (declare, Grid, Dialog){
return declare("modules.egisDataGrid", null, {
showFeedBack:function(){
var myDialog = new Dialog({
title: "FeedBackList",
style: "width: 600px; height:320px;",
content: ""
});
var data = [
{ first: "Bob", last: "Barker", age: 89 },
{ first: "Vanna", last: "White", age: 55 },
{ first: "Pat", last: "Sajak", age: 65 }
];
var grid = new Grid({
columns: {
first: "First Name",
last: "Last Name",
age: "Age"
}
}, myDialog.containerNode);
grid.renderArray(data);
grid.startup();
myDialog.show();
}
});
});
The dialog appears, but the layout is horribly messed up as follows:
I think this is due to the order in which the dgrid is initilized. I have tried everything I could think of, but I still can't figure out how to initilize it properly/