console
const getData = num => {
const data = [];
for (let i = 1; i<= num; i++) {
data.push({
"id": i,
"name": 'baukh-'+ i,
"age": "28",
"createDate": "2015-03-12",
"info": "野生前端程序"
});
}
return data;
};
const ajaxData = {
"data": getData(10000),
"totals": 10000
};
document.querySelector('#table-demo-virtualScroll').GM({
gridManagerName:'demo-virtualScroll',
supportAjaxPage: false,
virtualScroll: {
useVirtualScroll: true,
virtualNum: 20
},
ajaxData,
exportConfig: {
handler: (fileName, query, pageData, sortData, selectedList, tableData) => {
GM.showLoading('test');
GM.hideLoading('test', 500);
}
},
checkboxConfig: {
key: 'id'
},
columnData: [
{
key: 'name',
remind: 'the username',
sorting: 'up',
width: '200px',
text: 'username'
},{
key: 'age',
remind: 'the age',
sorting: '',
width: '200px',
text: 'age'
},{
key: 'info',
remind: 'the info',
sorting: '',
text: 'info'
},{
key: 'createDate',
text: '创建时间',
remind: 'the createDate',
sorting: 'down',
width: '200px',
fixed: 'right'
}
]
});
<table id='table-demo-virtualScroll'></table>