SpreadJS 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 GcSpread.Sheets.Spread($("#ss").get(0),{sheetCount:3}); spread.addSheet(); spread.bind(GcSpread.Sheets.Events.ActiveSheetChanging, function (sender, args) { //Cancel sheet switching. args.cancel = true; }); spread.bind(GcSpread.Sheets.Events.ActiveSheetChanged, function (sender, args) { console.log("Active sheet has been switched."); }); |