SpreadJS Documentation
ButtonClicked Event
GC.Spread.Sheets Namespace > Events type : ButtonClicked Event
The sheet that triggered the event.
The sheet's name.
The row index of the cell.
The column index of the cell.
The sheet area that contains the cell.
Occurs when the user clicks a button, check box, or hyperlink in a cell.
Syntax
var instance; // Type: Events
instance.ButtonClicked = function(sheet, sheetName, row, col, sheetArea) { };
ButtonClicked = function ( 
   sheet : Worksheet,
   sheetName : string,
   row : number,
   col : number,
   sheetArea : SheetArea
) { };

Parameters

sheet
The sheet that triggered the event.
sheetName
The sheet's name.
row
The row index of the cell.
col
The column index of the cell.
sheetArea
The sheet area that contains the cell.
Example
This example creates a button cell.
var cellType = new GC.Spread.Sheets.CellTypes.Button(); 
cellType.buttonBackColor("#FFFF00"); 
cellType.text("this is a button"); 
activeSheet.setCellType(1,1,cellType);

spread.bind(GC.Spread.Sheets.Events.ButtonClicked, function (e, args) {
    var sheet = args.sheet, row = args.row, col = args.col;
    var cellType = activeSheet.getCellType(row, col);
    if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) {
        alert("Button Clicked");
    }
});
See Also

Reference

Events type