SpreadJS Documentation
getSelections Method
Gets the selections in the current sheet.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: Array
value = instance.getSelections();
function getSelections() : Array;

Return Value

The type GcSpread.Sheets.Range is stored in an Array.
Example
This example uses the getSelections method.
activeSheet.setRowCount(5);
activeSheet.setColumnCount(5);
 $("#button1").click(function(){
        //Acquiring selection ranges
        var selectedRanges = activeSheet.getSelections();      
for(var i = 0; i < selectedRanges.length; i++){
alert(selectedRanges[i].row);
alert(selectedRanges[i].rowCount);
alert(selectedRanges[i].col);
alert(selectedRanges[i].colCount);
}
});  

//Add button control to page
<input type="button" id="button1" value="button1"/>
Remarks

See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.