轉帖|使用教程|編輯:鮑佳佳|2020-11-24 10:00:08.383|閱讀 227 次
概述:SpreadJS 是一款基于 HTML5 的純前端電子表格控件,能讓你在不到100行代碼,實現Excel所有功能,本文展示了如何使用SpreadJS創建一個商業儀表和數據表單,并給出了想要項目代碼!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
SpreadJS 是一款基于 HTML5 的純前端電子表格控件,兼容 450 種以上的 Excel 公式,憑借其 “高性能、跨平臺、與 Excel 高度兼容”的產品特性,備受以華為、蘇寧易購、天弘基金等為代表的企業用戶青睞。
事實上,SpreadJS 為用戶帶來親切的 Excel 使用體驗的同時,滿足 Web Excel 組件開發、表格文檔協同編輯、數據填報、Excel 類報表設計等業務場景,極大降低了企業研發成本和項目交付風險。
下面的示例展示了如何使用SpreadJS創建一個商業儀表和數據表單。
演示地址://demo.grapecity.com.cn/spreadjs/SpreadJSTutorial/sample/showcase/business-dashboard/purejs/
app.js:
window.onload = function () { var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 }); initSpread(spread); }; function initSpread(spread) { var sd = data; if (sd.length > 0) { if (!spread) { return; } spread.suspendPaint(); spread.fromJSON(sd[0]); spread.resumePaint(); } }
index.html:
<!doctype html> <html style="height:100%;font-size:14px;"> <head> <meta name="spreadjs culture" content="zh-cn" /> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets-resources-zh/dist/gc.spread.sheets.resources.zh.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/spread/source/js/license.js" type="text/javascript"></script> <script src="$DEMOROOT$/spread/source/data/financialKPIs.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" style="width:100%;height:100%"></div> </div> </body> </html>
style.css:
.sample-tutorial { position: relative; height: 100%; overflow: hidden; } body { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
本篇文章你學會了嗎 !趕快下載體驗吧!獲取更多教程資訊>>
本文轉載自:
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: