把这个贴到你那个 demo 下面的,app.js 替换,点击运行,点击链接没有问题,鼠标滑轮向下滚动一点,你会发现超链接点不了了!
- window.onload = function () {
- var spread = new GC.Spread.Sheets.Workbook(_getElementById('ss'), { sheetCount: 1 });
- initSpread(spread);
- };
- function initSpread(spread) {
- var switchAutoMergeDirection = _getElementById("switchAutoMergeDirection");
- switchAutoMergeDirection.addEventListener("change", function (event) {
- var range = new GC.Spread.Sheets.Range(-1, -1, -1, -1);
- var sheet = spread.getActiveSheet();
- sheet.suspendPaint();
- //remove old auto merge range
- sheet.autoMerge(range, GC.Spread.Sheets.AutoMerge.AutoMergeDirection.none);
- //add new auto merge range
- sheet.autoMerge(range, parseInt(event.target.value));
- sheet.resumePaint();
- });
- spread.suspendPaint();
- spread.options.showVerticalScrollbar = false;
- spread.options.showHorizontalScrollbar = false;
- spread.options.tabStripVisible = false;
- //init sheet
- var sheet = spread.getActiveSheet();
- sheet.defaults.rowHeight = 40;
- sheet.defaults.colWidth = 100;
- sheet.defaults.colHeaderRowHeight = 40;
- sheet.defaults.rowHeaderColWidth = 60;
- sheet.setRowCount(50);
- sheet.setColumnCount(7);
- var defaultStyle = sheet.getDefaultStyle();
- defaultStyle.vAlign = GC.Spread.Sheets.VerticalAlign.center;
- defaultStyle.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
- sheet.setDefaultStyle(defaultStyle);
- ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"].forEach(function (value, index) {
- sheet.setValue(0, index, value, GC.Spread.Sheets.SheetArea.colHeader);
- });
- ["12:00", "13:00", "14:00", "15:00", "16:00"].forEach(function (value, index) {
- sheet.setValue(index, 0, value, GC.Spread.Sheets.SheetArea.rowHeader);
- });
- sheet.setArray(0, 0, [
- ["Walker", "Morning Show", "Morning Show", "Sport", "Weather", "N/A", "N/A"],
- ["Today Show", "Today Show", "Kid Zone", "Football", "Soap Opera", "N/A", "N/A"],
- ["Today Show", "Today Show", "Kid Zone", "Football", "Soap Opera", "N/A", "N/A"],
- ["Today Show", "Today Show", "Kid Zone", "Football", "Soap Opera", "N/A", "N/A"],
- ["Today Show", "Today Show", "Kid Zone", "Football", "Soap Opera", "N/A", "N/A"],
- ["Today Show", "Today Show", "Sesame Street", "Football", "Market Watch", "N/A", "N/A"],
- ["Today Show", "Today Show", "Kid Zone", "Football", "Soap Opera", "N/A", "N/A"],
- ["News", "News", "News", "News", "News", "N/A", "N/A"],
- ["News", "News", "News", "News", "News", "N/A", "N/A"]
- ]);
- //apply auto merge
- var range = new GC.Spread.Sheets.Range(-1, -1, -1, -1);
- sheet.autoMerge(range, GC.Spread.Sheets.AutoMerge.AutoMergeDirection.columnRow);
- sheet.setHyperlink(1, 0, {
- linkColor: '#0066cc',
- visitedLinkColor: '#3399ff',
- command: () => {alert('click')},
- });
- sheet.setHyperlink(2, 0, {
- linkColor: '#0066cc',
- visitedLinkColor: '#3399ff',
- command: () => {alert('click')},
- });
- spread.resumePaint();
- }
- function _getElementById(id) {
- return document.getElementById(id);
- }
复制代码
|