SpreadJS Documentation
Creating and Removing Selections

You can create or remove selections.

Using Code

This example creates and removes selections.

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

    $("#button1").click(function(){
        //Select entire row 4.
        $("#ss").data("spread").getActiveSheet().addSelection(3, -1, 1, -1);
    });

    $("#button2").click(function(){
        //Remove the selections in the sheet.
        $("#ss").data("spread").getActiveSheet().clearSelection();
    });
});
See Also

Developer's Guide

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.