SpreadJS Documentation
CellClick Event
The sheet that triggered the event.
The sheet's name.
The sheet area the clicked cell is in.
The row index of the clicked cell.
The column index of the clicked cell.
Occurs when the user presses down the left mouse button in a cell.
Syntax
var instance; // Type: Events
instance.CellClick = function(sheet, sheetName, sheetArea, row, col) { };
CellClick = function ( 
   sheet : Sheet,
   sheetName : string,
   sheetArea : SheetArea,
   row : number,
   col : number
) { };

Parameters

sheet
The sheet that triggered the event.
sheetName
The sheet's name.
sheetArea
The sheet area the clicked cell is in.
row
The row index of the clicked cell.
col
The column index of the clicked cell.
Example
This example uses the CellClick event.
// Use IE to see the console log text

activeSheet.bind(GcSpread.Sheets.Events.CellClick, function (sender, args) {
    if(args.sheetArea === GcSpread.Sheets.SheetArea.colHeader){
        console.log("The column header was clicked.");
    }

    if(args.sheetArea === GcSpread.Sheets.SheetArea.rowHeader){
        console.log("The row header was clicked.");
    }

    if(args.sheetArea === GcSpread.Sheets.SheetArea.corner){
        console.log("The corner header was clicked.");
    }

    console.log("Clicked column index: " + args.col);
    console.log("Clicked row index: " + args.row);
});

activeSheet.bind(GcSpread.Sheets.Events.CellDoubleClick, function (sender, args) {
    if(args.sheetArea === GcSpread.Sheets.SheetArea.colHeader){
        console.log("The column header was double clicked.");
    }

    if(args.sheetArea === GcSpread.Sheets.SheetArea.rowHeader){
        console.log("The row header was double clicked.");
    }

    if(args.sheetArea === GcSpread.Sheets.SheetArea.corner){
        console.log("The corner header was double clicked.");
    }

    console.log("Double clicked column index: " + args.col);
    console.log("Double clicked row index: " + args.row);
});
See Also

Reference

Events type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.