Closed beeant0512 closed 4 years ago
It looks like you're not using a dstore data store for your collection. It would be easier if we saw how pageData was created. If pageData was created using a dstore data object (like dstore/Memory), you would add the datalist like the following:
pageData.data = dataList;
You can see example code of how to use pagination in the dgrid Laboratory.
require([
'dojo/_base/declare',
'dstore/Memory',
'dstore/Trackable',
'dgrid/Grid',
'dgrid/extensions/Pagination'
], function (declare, Memory, Trackable, Grid, Pagination) {
var store = new (declare([Memory, Trackable]))({
data: createData()
});
// Instantiate grid
var grid = new (declare([Grid, Pagination]))({
collection: store,
columns: {
First_Name: {
label: 'First Name'
},
Last_Name: {
label: 'Last Name'
}
}
}, 'grid');
grid.startup();
function createData() {
var data = [];
var column;
var i;
var item;
for (i = 0; i < 50; i++) {
item = {};
for (column in { First_Name: 1, Last_Name: 1 }) {
item.id = i;
item[column] = column + '_' + (i + 1);
}
data.push(item);
}
return data;
}
});
when i create a Pagination grid throw the error , here is my code
var dataList = [ { col1: 'normal', col2: false, col3: 'new', col4: 'But are not followed by two hexadecimal', col5: 29.91, col6: 10, col7: false },...... ];