数据源用[{}]
参考下面代码实现
- var datasource = [{}
-
- ];
- // bindColumn one by one
- var nameColInfo = { name: 'name', displayName: 'Display Name', size: 70 };
- var ageColInfo = { name: 'age', displayName: 'Age', size: 40, resizable: false };
- var birthdayColInfo = { name: 'birthday', displayName: 'Birthday', formatter: 'd/M/yy', size: 120 };
- var positionColInfo = { name: 'position', displayName: 'Position', size: 50, visible: false };
- sheet.autoGenerateColumns = false;
- sheet.setDataSource(datasource);
- sheet.bindColumn(0, nameColInfo);
- sheet.bindColumn(1, birthdayColInfo);
- sheet.bindColumn(2, ageColInfo);
- sheet.bindColumn(3, positionColInfo);
复制代码 |