您好,
自定义了一个test区域,button1会增加一行。
您描述的功能可以参考以下代码:
- <script type="text/javascript">
- $(document).ready(function() {
- var spread = new GcSpread.Sheets.Spread($("#ss").get(0), {
- sheetCount: 3
- });
- var activeSheet = spread.getActiveSheet();
- activeSheet.setValue(0, 0, 1);
- activeSheet.setValue(1, 0, 1);
- activeSheet.setValue(2, 0, 1);
- activeSheet.setValue(0, 1, 1);
- activeSheet.setValue(1, 1, 1);
- activeSheet.setValue(2, 1, 1);
- activeSheet.addCustomName("test","Sheet1!$A$1:$B$3", 0, 0);
- activeSheet.setFormula(0, 2, "SUM(test)");
- $("#button1").click(function() {
- activeSheet.addRows(0, 1);
- });
- });
- </script>
复制代码
- <body>
- <div id="ss" style="width: 500px; height: 300px; border: 1px solid gray">
- </div>
- <input type="button" id="button1" value="button1"/>
- </body>
复制代码
2015-09-06_144348.jpg
(28.09 KB, 下载次数: 793)
|