SpreadJS Documentation
Creating a Custom Action Map

You can create a custom action map.

Using Code

This example creates a custom action map for the Enter key.

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

    //Map the created action to Enter key.
    activeSheet.addKeyMap(GcSpread.Sheets.Key.enter, false, false, false, false, ColorAction);
});

function ColorAction(){
    //Obtain active sheets.
    var spread = $("#ss").data("spread");
    var activeSheet = spread.getActiveSheet();
    //Configure background colors for those active cells.
    activeSheet.getCell(activeSheet.getActiveRowIndex(), activeSheet.getActiveColumnIndex())
        .backColor("red");
}
See Also

Developer's Guide

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.