您好:
参考下面代码:
$(function () {
            var spread = new GC.Spread.Sheets.Workbook($("#ss")[0]);
            var activeSheet = spread.getActiveSheet();
            spread.commandManager().execute({cmd: "outlineRow", sheetName: activeSheet.name(), index: 3, count: 5});
            $("#button1").click(function () {
                if(spread.undoManager().canUndo()){
                    spread.undoManager().undo();
                }
            });
            $("#button2").click(function () {
                if(spread.undoManager().canRedo()){
                    spread.undoManager().redo();
                }
            });
        })
spread.undoManager().undo();就是直接执行撤销操作,spread.undoManager().redo();就是执行恢复操作
只需撤销的内容和恢复的内容这个spreadjs本身会有控制。 |