SpreadJS Documentation
Changing the Active Cell Backcolor

You can change the color of the active cell.

Using Code

This example changes the color of the active cell.

JavaScript
Copy Code
$(document).ready(function () {
    var spread = new GcSpread.Sheets.Spread($("#ss").get(0),{sheetCount:3});
    var sheet = spread.getActiveSheet();
    sheet.getCell(0, 0).backColor("pink");

    sheet.bind(GcSpread.Sheets.Events.LeaveCell, function (event, infos) {
        //Reset the backcolor of cell before moving
        infos.sheet.getCell(infos.row, infos.col).backColor(undefined);
    });

    sheet.bind(GcSpread.Sheets.Events.EnterCell, function (event, infos) {
        //Set the backcolor of destination cells (currently active cells)
        infos.sheet.getCell(infos.row, infos.col).backColor("pink");
    });
});
See Also

Developer's Guide

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.