Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

你可以使用 ThemeRoller 创建  JQuery 主题,并将其在 Spread.Sheets 中引用。

关于 ThemeRoller 的详细信息,请参阅: jqueryui.com/themeroller.

创建自定义主题,并且将它们放到 Spread.Sheets 页面上。比如:

<link href="css/gcspread.sheets.x.xx.xxxxx.x.css" rel="stylesheet" type="text/css" />

<link href="css/black-tie/jquery-ui.css " rel="stylesheet" type="text/css" />

如果你从服务器端下载了主题,也可以使用一个 timer 来刷新控件。

示例代码

以下代码使用了 timer。

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Spread Sample</title>
    <link href="./css/gc.spread.sheets.10.x.x.css" rel="stylesheet"/>
    <link href="https://code.jquery.com/ui/1.11.4/themes/overcast/jquery-ui.css" rel="stylesheet" type="text/css"
          title="themeRuler"/>
<script src="http://code.jquery.com/jquery-2.1.1.js" type="text/javascript"></script>
    <script src="./scripts/gc.spread.sheets.all.10.x.x.js" type="application/javascript"></script>
    <script>
        $(function () {
            var spread = new GC.Spread.Sheets.Workbook($("#ss")[0]);
            $("#btn").click(function () {
                $("link[title='themeRuler']")[0].href = "https://code.jquery.com/ui/1.11.4/themes/sunny/jquery-ui.css";
                setTimeout(
                        function () {
                            var spread = $("#ss").data("workbook");
                            spread.refresh();
                        }, 500);
            })
        })
    </script>
</head>
<body>
<div id="ss" style="width:50%;height:500px;border:solid 1px gray"></div>
<input type="button" id="btn" value="Change Theme"/>
</body>
</html> 
  • No labels