Spread.Sheets Documentation > Sample Code > Sample Code for Frequently Used Events > Using Events when the Sheet Tab Changes |
You can use events when the sheet tab changes.
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."); }); |