body {
background: rgb(250, 250, 250);
color: #333;
}
#ss {
border: 1px #ccc solid;
}
.container {
width: 80%;
background: rgb(250, 250, 250);
margin: 0 auto;
height: 480px;
}
.full-height {
height: 100%;
}
.height50 {
height: 50%;
}
.left{
height: 100%;
overflow: auto;
}
表单名称标签
滚动条
绘制
背景
鼠标拉到最底或最右可见灰色区域填充的背景色
$(document).ready(function () {
//可以传两个参数,另一个{sheetCount: 2}
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
// 获取Spread对象
var spread = GC.Spread.Sheets.findControl(document.getElementById('ss'));
// spread.setActiveSheet('Sheet2');
var sheet = spread.getActiveSheet();
sheet.setColumnCount(5);
sheet.setRowCount(10);
sheet.options.sheetTabColor = 'red';
document.getElementById('new').checked= true;
document.getElementById('tabEditable').checked = true;
document.getElementById('allowSheetReorder').checked = true;
// 新增按钮
document.getElementById('new').addEventListener('click', function() {
spread.options.newTabVisible = this.checked;
});
// 标签是否可编辑
document.getElementById('tabEditable').addEventListener('click', function() {
spread.options.tabEditable = this.checked;
});
// 是否允许拖动改变表单顺序
document.getElementById('allowSheetReorder').addEventListener('click', function() {
spread.options.allowSheetReorder = this.checked;
});
// 其他显示
spread.options.tabNavigationVisible = true;
spread.options.tabStripVisible = true;
spread.options.tabStripRatio = 0.9;
/*-------------------------滚动条--------------------------*/
document.getElementById('scroll').checked = true;
document.getElementById('scroll').addEventListener('click', function() {
spread.options.showHorizontalScrollbar = this.checked;
});
document.getElementById('scroll1').addEventListener('click', function() {
//horizontal,vertical;both;none 拖动滚动条给出提示,默认none
spread.options.showScrollTip = GC.Spread.Sheets.ShowScrollTip.horizontal;
});
document.getElementById('scroll2').addEventListener('click', function() {
//horizontal,vertical;both;none 拖动滚动条给出提示,默认none
spread.options.showScrollTip = GC.Spread.Sheets.ShowScrollTip.vertical;
});
spread.options.showVerticalScrollbar = true; // 控制水平或竖直滚动条是否显示 showVerticalScrollbar,showHorizontalScrollbar
spread.options.scrollbarMaxAlign = true; //滚动条末尾是否对齐视图中表单的最后一行或一列
/*-----------------绘制---------------------*/
document.getElementById('suspendPaint').addEventListener('click', function() {
spread.suspendPaint();
});
document.getElementById('resumePaint').addEventListener('click', function() {
spread.resumePaint();
});
/*------------------背景---------------------------*/
document.getElementById('bag').addEventListener('click', function() {
spread.options.backColor = '#a079e8';
});
document.getElementById('grayAreaBackColor').addEventListener('click', function() {
spread.options.grayAreaBackColor = '#351969';
});
spread.options.backgroundImage = 'img/bag.jpg'; //同时设置,图片优先
// spread.options.backgroundImageLayout = GC.Spread.Sheets.ImageLayout.stretch; //stretch,center,zoom,none
spread.options.backColor = '#a079e8';
});