You can create a custom jQuery theme using the ThemeRoller and then use the theme with SpreadJS.
You can find the ThemeRoller at jqueryui.com/themeroller.
Create the custom theme and then add the link to the page after the SpreadJS link. For example:
<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" />
You may also wish to use a timer to refresh the widget if downloading the theme from a server.
Using Code
This example uses a timer.
JavaScript |
Copy Code
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spread Sample</title>
<link href="./css/gc.spread.sheets.12.0.0.css" rel="stylesheet"/>
<link href="https://code.jquery.com/ui/1.12.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.12.0.0.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.12.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>
|