SpreadJS Documentation
setCellType Method
The row index.
The column index.
The cell type.
The sheet area. If this parameter is not provided, it defaults to viewport.
Sets the cell type.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var returnValue; // Type: any
returnValue = instance.setCellType(row, col, value, sheetArea);
function setCellType( 
   row : number,
   col : number,
   value : BaseCellType,
   sheetArea : SheetArea
) : any;

Parameters

row
The row index.
col
The column index.
value
The cell type.
sheetArea
The sheet area. If this parameter is not provided, it defaults to viewport.
Example
This example uses the setCellType method.
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

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.