I have tried implementing a class for a grid layout using dgrid (using their sample), but I get this error when loading my grid (subRows is undefined). My code looks something like this:
define([
"dojo/_base/declare",
"dojo/_base/lang",
"dgrid/Grid",
"dgrid/Keyboard",
"dgrid/Selection"
], function(
declare,
lang,
Grid,
Keyboard,
Selection
){
return declare([Grid, Keyboard, Selection], {
columns: {
first: "First Name",
last: "Last Name",
age: "Age"
},
selectionMode: "single", // for Selection; only select a single row at a time
cellNavigation: false, // for Keyboard; allow only row-level keyboard navigation
constructor: function() {
var data = [
{ first: "Bob", last: "Barker", age: 89 },
{ first: "Vanna", last: "White", age: 55 },
{ first: "Pat", last: "Sajak", age: 65 }
];
this.renderArray(data);
}
});
});
And calling/creating it like this,
app.gridLayout = new GridLayout().placeAt(document.body);