SpreadJS Documentation > Sample Code > Sample Code for Rows and Columns > Creating and Removing Selections |
You can create or remove selections.
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(); }); }); |