Skip to content

Commit c1d2f23

Browse files
author
Theo Ephraim
committed
clarify docs around loading cells
1 parent 4cec425 commit c1d2f23

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ More info:
100100

101101
### Working with cells
102102
```javascript
103-
await sheet.loadCells('A1:E10'); // loads a range of cells
103+
await sheet.loadCells('A1:E10'); // loads range of cells into local cache - DOES NOT RETURN THE CELLS
104104
console.log(sheet.cellStats); // total cells, loaded, how many non-empty
105105
const a1 = sheet.getCell(0, 0); // access cells using a zero-based index
106106
const c6 = sheet.getCellByA1('C6'); // or A1 style notation

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ More info:
104104

105105
### Working with cells
106106
```javascript
107-
await sheet.loadCells('A1:E10'); // loads a range of cells
107+
await sheet.loadCells('A1:E10'); // loads range of cells into local cache - DOES NOT RETURN THE CELLS
108108
console.log(sheet.cellStats); // total cells, loaded, how many non-empty
109109
const a1 = sheet.getCell(0, 0); // access cells using a zero-based index
110110
const c6 = sheet.getCellByA1('C6'); // or A1 style notation

docs/classes/google-spreadsheet-worksheet.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ The cell-based interface lets you load and update individual cells in a sheeet,
136136
#### `loadCells(filters)` (async) :id=fn-loadCells
137137
> Fetch cells from google
138138
139-
You can filter the cells you want to fetch in several ways. See [Data Filters](https://developers.google.com/sheets/api/reference/rest/v4/DataFilter) for more info. Strings are treated as A1 ranges, objects are detected to be a [GridRange](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#GridRange) with sheetId not required.
139+
!> This method does not return the cells it loads, instead they are kept in a local cache managed by the sheet. See methods below (`getCell` and `getCellByA1`) to access them.
140140

141-
**NOTE - if using an API key (read-only access), only A1 ranges are supported**
141+
You can filter the cells you want to fetch in several ways. See [Data Filters](https://developers.google.com/sheets/api/reference/rest/v4/DataFilter) for more info. Strings are treated as A1 ranges, objects are detected to be a [GridRange](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#GridRange) with sheetId not required.
142142

143143
```javascript
144144
await sheet.loadCells(); // no filter - will load ALL cells in the sheet
@@ -150,11 +150,13 @@ await sheet.loadCells({ startRowIndex: 50 }); // not all props required
150150
await sheet.loadCells(['B2:D5', 'B50:D55']); // can pass an array of filters
151151
```
152152

153+
!> If using an API key (read-only access), only A1 ranges are supported
154+
153155
Param|Type|Required|Description
154156
---|---|---|---
155157
`filters`|*|-|Can be a single filter or array of filters
156158

157-
-**Side effects** - cells are loaded in the doc, `cellStats` is updated
159+
-**Side effects** - cells are loaded into local cache, `cellStats` is updated
158160

159161

160162
#### `getCell(rowIndex, columnIndex)` :id=fn-getCell

0 commit comments

Comments
 (0)