SpreadJS는 다음 플랫폼에서 터치를 지원합니다:
Desktop: Windows--IE 9+, Chrome, Firefox, Opera
Tablet PC: iPad--Chrome, Safari; Android Pad--Chrome; Surface--IE 10+
Mobile: Android--Chrome; Windows Phone: IE 10+
useTouchLayout 옵션을 사용하여 터치 레이아웃으로 Spread 위젯을 표시할지 여부를 가져오고 설정할 수 있습니다. 터치 레이아웃에서 컨트롤을 보다 쉽게 터치할 수 있습니다.
SpreadJS는 스크롤, 확대/축소, 선택, 크기 조정, 끌어서 채우기, 그룹, 셀 유형, 자동 맞춤, 필터, 편집, 연속 탭 및 도구 상자를 포함한 터치 모드의 많은 기능을 지원합니다.
window.onload = function () {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
spread.options.useTouchLayout = true;
var sd = dataSource;
var sheet = spread.getActiveSheet();
if (sd.length > 0) {
sheet.setDataSource(sd);
}
sheet.setColumnWidth(0, 160);
sheet.setColumnWidth(1, 70);
sheet.setColumnWidth(2, 90);
sheet.setColumnWidth(3, 110);
sheet.setColumnWidth(4, 80);
sheet.setColumnWidth(6, 110);
document.getElementById('useTouchLayout').onclick = function (e) {
spread.options.useTouchLayout = e.target.checked;
};
};
<!doctype html>
<html style="height:100%;font-size:14px;">
<head>
<meta name="spreadjs culture" content="ko-kr"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="$DEMOROOT$/ko/purejs/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css">
<script src="$DEMOROOT$/ko/purejs/node_modules/@mescius/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script>
<script src="$DEMOROOT$/spread/source/data/data.js" type="text/javascript"></script>
<script src="$DEMOROOT$/ko/purejs/node_modules/@mescius/spread-sheets-resources-ko/dist/gc.spread.sheets.resources.ko.min.js" type="text/javascript"></script>
<script src="$DEMOROOT$/spread/source/js/license.js" type="text/javascript"></script>
<script src="app.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="sample-tutorial">
<div class="options-container">
<input type="checkbox" id="useTouchLayout" checked="checked">
<label for="useTouchLayout">Enable Touch</label>
</div>
<hr>
<div id="ss" class="sample-spreadsheets"></div>
</div>
</body>
</html>
.sample-tutorial {
position: relative;
height: 100%;
overflow: hidden;
}
.sample-spreadsheets {
width: 100%;
height: calc(100% - 70px);
overflow: hidden;
float: bottom;
}
.options-container {
float: top;
width: 100%;
padding: 12px;
height: 50px;
box-sizing: border-box;
background: #fbfbfb;
overflow: auto;
}
.option-row {
font-size: 14px;
padding: 5px;
margin-top: 10px;
}
label {
margin-bottom: 6px;
}
input {
padding: 4px 6px;
}
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}