JavaScript
// 샘플 데이터 100건 생성
const depts = ['영업팀', '개발팀', '마케팅팀', '인사팀', '지원팀'];
const data = [];
for (let i = 1; i <= 100; i++) {
data.push({
id: i,
name: '직원 ' + i,
dept: depts[i % depts.length],
sales: ((i * 37) % 90 + 10) * 10000
});
}
// pageSize를 지정하면 페이징이 활성화됩니다
const view = new wijmo.collections.CollectionView(data, { pageSize: 10 });
const grid = new wijmo.grid.FlexGrid('#myGrid', {
itemsSource: view,
isReadOnly: true,
autoGenerateColumns: false,
columns: [
{ binding: 'id', header: '번호', width: 80 },
{ binding: 'name', header: '이름', width: '*' },
{ binding: 'dept', header: '부서', width: '*' },
{ binding: 'sales', header: '실적(원)', format: 'n0', width: '*' }
]
});