워크시트의 하이퍼링크를 클릭하면 링크 주소에 빠르게 액세스할 수 있습니다.
다음과 같은 링크 주소 링크를 추가할 수 있습니다.
또한 파일에 연결되는 링크를 클릭하여 브라우저를 통해 파일을 열 수도 있습니다.
하이퍼링크가 로컬 파일에 연결된 경우 file:// 라는 접두사가 필요합니다.
window.onload = initFunction;
function initFunction() {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount: 2});
var sheet = spread.getActiveSheet();
spread.suspendPaint();
sheet.fromJSON(urlAddressJsonData);
sheet.setHyperlink(0, 1, { url: "www.google.com", tooltip: "Google" });
sheet.setHyperlink(1, 1, { url: "https://www.microsoft.com", tooltip: "Microsoft" });
sheet.setHyperlink(2, 1, { url: "www.baidu.com", tooltip: "Baidu" });
sheet.setHyperlink(3, 1, { url: "https://www.facebook.com", tooltip: "Facebook" });
sheet.setHyperlink(4, 1, { url: "https://www.nike.com", tooltip: "Nike" });
sheet.setHyperlink(5, 1, { url: "https://www.apple.com", tooltip: "Apple" });
sheet.setHyperlink(6, 1, { url: "https://www.spotify.com", tooltip: "Spotify" });
sheet.setHyperlink(7, 1, { url: "https://www.buzzfeed.com", tooltip: "Buzzfeed" });
sheet.setHyperlink(8, 1, { url: "https://www.bankofamerica.com", tooltip: "Bank of America" });
sheet.setHyperlink(9, 1, { url: "https://www.bcg.com", tooltip: "Boston Consulting Group" });
spread.resumePaint();
}
<!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$/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="$DEMOROOT$/spread/source/data/hyperlink-data.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 id="ss" class="sample-spreadsheets"></div>
</div></body>
</html>
.sample-tutorial {
position: relative;
height: 100%;
overflow: hidden;
}
.sample-spreadsheets {
width: 100%;
height: 100%;
overflow: hidden;
float: left;
}
.options-container {
float: right;
padding: 12px;
height: 100%;
width: 100%;
box-sizing: border-box;
background: #fbfbfb;
overflow: auto;
}
.option-row {
font-size: 14px;
padding: 5px;
}
input {
display:block;
width: 100%;
margin: 8px 0;
box-sizing: border-box;
}
label, input {
padding: 4px 6px;
}
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
#drawUnderline {
display: inline-block;
width: 30px;
}
#drawUnderlineLabel {
display: inline-block;
}
#allowAutoCreateHyperlink {
display: inline-block;
width: 30px;
}