SpreadJS Documentation > Developer's Guide > Managing the User Interface > Working with Cell Types > Setting a Button Cell |
You can display a button in a cell using the button cell. You can also set appearance properties such as color and text.
When the allowEditorReservedLocations method is set to false, all cell editors are prohibited from showing custom cursors over parts of the cell and from entering edit mode on a single click over those parts of the cell. Button and combo cells and cells with drop-down buttons will not go into edit mode immediately, and instead the mouse selection will treat those cells as cells without buttons that can be selected. |
This example creates a button cell and sets the cell backcolor.
JavaScript |
Copy Code
|
---|---|
var cellType = new GcSpread.Sheets.ButtonCellType(); cellType.buttonBackColor("#FFFF00"); cellType.text("this is a button"); activeSheet.getCell(0, 2).cellType(cellType); |