You can change the bottom right ending edge of an existing range using the setEndBound function, passing in the Cell Component for the bottom right bound of the selection:
You can change the top left start edge of an existing range using the setStartBound function, passing in the Cell Component for the top left bound of the selection:
You can clear the value of every cell in a range by calling the clearValues function on the range:
var data = range.clearValues();
This will set the value of every cell in the range to the value of the selectableRangeClearCellsValue table option, which is set to undefined by default.
You can retrieve the bounds of a range by calling the getBounds function on the range:
var bounds = range.getBounds();
This will return an object containing two Cell Components, for the two bounds of the range
{
start:Component, //the cell component at the top left of the range
end:Component, //the cell component at the bottom right of the range
}
You can retrieve all the Cell Components in a range by calling the getCells function on the range:
var cells = range.getCells();
This will return a array of Cell Components
You can retrieve all the Column Components in a range by calling the getColumns function on the range:
var columns = range.getColumns();
This will return a array of Column Components
You can retrieve the cell data for a range by calling the getData function on the range:
var data = range.getData();
This will return a range data array, which is structured as a series of row data objects with only the props for cells in that range:
[
{color:"green", country:"England", driver:true}, //data for selected cells in first row in range
{color:"red", country:"USA", driver:false}, //data for selected cells in second row in range
{color:"blue", country:"France", driver:true}, //data for selected cells in third row in range
]
You can retrieve all the Row Components in a range by calling the getRows function on the range:
var rows = range.getRows();
This will return a array of Row Components
You can retrieve a structured map of all the Cell Components in a range by calling the getStructuredCells function on the range:
var cells = range.getStructuredCells();
This will return a array of row arrays, with each row array containing the Cell Components in order for that row:
[
[Component, Component, Component], //first row
[Component, Component, Component], //second row
[Component, Component, Component], //third row
]
You can update the bounds for an existing range using the setBounds function, passing in the Cell Components for the top-left and bottom-right bounds of the selection: