With the following code fragment, the grid shows only column headers. To show the data, I need to add the last line. Why renderArray is needed for the data to show in the grid?
var data = [
{ first: 'Bob', last: 'Barker', age: 89 },
{ first: 'Vanna', last: 'White', age: 55 },
{ first: 'Pat', last: 'Sajak', age: 65 }
];
var store = new Memory({ data: data });
var grid = new OnDemandGrid({
collection: store,
columns: {
first: 'First Name',
last: 'Last Name',
age: 'Age'
}
});
grid.startup();
//grid.renderArray(data);
Which version of the API are you using? I simply copy/pasted your code into a JSFiddle referencing the 4.1 API and it seems to work just fine:
https://jsfiddle.net/shenningsgard/udxkuqr1/3/
HTML:
JS:
Result: