SpreadJS Documentation
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 : Sheet,
   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 GcSpread.Sheets.ButtonCellType(); 
cellType.buttonBackColor("#FFFF00"); 
cellType.text("this is a button"); 
activeSheet.setCellType(1,1,cellType);

spread.bind(GcSpread.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 GcSpread.Sheets.ButtonCellType) {
        alert("Button Clicked");
    }
});
See Also

Reference

Events type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.