SpreadJS 14
Frequently Used Events / Use Events when the Sheet Tab Changes
In This Topic
    Use Events when the Sheet Tab Changes
    In This Topic

    You can use events when the sheet tab changes.

    Using Code

    This example cancels the tab change.

    JavaScript
    Copy Code
    var spread = 
    new GC.Spread.Sheets.Workbook(document.getElementById("ss"),
    {sheetCount:3});
    spread.addSheet();
    spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanging, 
    function (sender, args) 
    {
        // Cancel sheet switching.
        args.cancel = true;
    });
    
    spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, function (sender, args) 
    {
        console.log("Active sheet has been switched.");
    });
    
    See Also

    Developer's Guide