@@ -164,10 +164,15 @@ function MyComponent() {
164164
165165### Cell Updates
166166
167+ ** Note** : The ` sync ` function used in the examples below should be obtained from the ` connector ` as shown in the "Using Table References" section above.
168+
167169#### ` update(args: { diff: CellsByAddressType; historicize?: boolean; partial?: boolean; updateChangedTime?: boolean; reflection?: StorePatchType }): UserTable `
168170Updates multiple cells at once.
169171
170172``` tsx
173+ // Get sync from connector
174+ const { table, sync } = connector .current .tableManager ;
175+
171176const newTable = table .update ({
172177 diff: {
173178 ' A1' : { value: ' Updated Value' },
@@ -182,6 +187,9 @@ sync(newTable); // Required to apply changes
182187Writes a value to a specific cell.
183188
184189``` tsx
190+ // Get sync from connector
191+ const { table, sync } = connector .current .tableManager ;
192+
185193const newTable = table .write ({
186194 point: { x: 1 , y: 1 },
187195 value: ' Hello World'
@@ -193,6 +201,9 @@ sync(newTable); // Required to apply changes
193201Writes a matrix of values starting at a specific point.
194202
195203``` tsx
204+ // Get sync from connector
205+ const { table, sync } = connector .current .tableManager ;
206+
196207const newTable = table .writeMatrix ({
197208 point: { x: 1 , y: 1 },
198209 matrix: [[' A1' , ' B1' ], [' A2' , ' B2' ]]
@@ -207,6 +218,9 @@ sync(newTable); // Required to apply changes
207218Inserts rows at the specified position. If ` diff ` is provided, it also updates the cells after insertion.
208219
209220``` tsx
221+ // Get sync from connector
222+ const { table, sync } = connector .current .tableManager ;
223+
210224const newTable = table .insertRows ({
211225 y: 5 ,
212226 numRows: 2 ,
@@ -216,12 +230,16 @@ const newTable = table.insertRows({
216230 A6: { value: ' New Row 2' },
217231 },
218232});
233+ sync (newTable ); // Required to apply changes
219234```
220235
221236#### ` removeRows(args: { y: number; numRows: number; reflection?: StorePatchType }): UserTable `
222237Removes rows at a specific position.
223238
224239``` tsx
240+ // Get sync from connector
241+ const { table, sync } = connector .current .tableManager ;
242+
225243const newTable = table .removeRows ({
226244 y: 2 ,
227245 numRows: 3
@@ -236,6 +254,9 @@ sync(newTable); // Required to apply changes
236254Inserts columns at the specified position. If ` diff ` is provided, it also updates the cells after insertion.
237255
238256``` tsx
257+ // Get sync from connector
258+ const { table, sync } = connector .current .tableManager ;
259+
239260const newTable = table .insertCols ({
240261 x: 3 ,
241262 numCols: 2 ,
@@ -245,12 +266,16 @@ const newTable = table.insertCols({
245266 D1: { value: ' New Col 2' },
246267 },
247268});
269+ sync (newTable ); // Required to apply changes
248270```
249271
250272#### ` removeCols(args: { x: number; numCols: number; reflection?: StorePatchType }): UserTable `
251273Removes columns at a specific position.
252274
253275``` tsx
276+ // Get sync from connector
277+ const { table, sync } = connector .current .tableManager ;
278+
254279const newTable = table .removeCols ({
255280 x: 2 ,
256281 numCols: 3
@@ -264,6 +289,9 @@ sync(newTable); // Required to apply changes
264289Moves cells from one area to another.
265290
266291``` tsx
292+ // Get sync from connector
293+ const { table, sync } = connector .current .tableManager ;
294+
267295const newTable = table .move ({
268296 src: { top: 0 , left: 0 , bottom: 2 , right: 2 },
269297 dst: { top: 5 , left: 5 , bottom: 7 , right: 7 }
@@ -275,6 +303,9 @@ sync(newTable); // Required to apply changes
275303Copies cells from one area to another.
276304
277305``` tsx
306+ // Get sync from connector
307+ const { table, sync } = connector .current .tableManager ;
308+
278309const newTable = table .copy ({
279310 src: { top: 0 , left: 0 , bottom: 2 , right: 2 },
280311 dst: { top: 5 , left: 5 , bottom: 7 , right: 7 },
@@ -289,6 +320,9 @@ sync(newTable); // Required to apply changes
289320Sorts all data rows by the values in the specified column. Supports ascending and descending order. Null/undefined values are sorted to the end. This operation is recorded in the undo/redo history.
290321
291322``` tsx
323+ // Get sync from connector
324+ const { table, sync } = connector .current .tableManager ;
325+
292326// Sort by column B ascending
293327const newTable = table .sortRows ({ x: 2 , direction: ' asc' });
294328sync (newTable );
@@ -332,6 +366,9 @@ Available filter methods:
332366| ` notEmpty ` | Cell is not empty (no value required) |
333367
334368``` tsx
369+ // Get sync from connector
370+ const { table, sync } = connector .current .tableManager ;
371+
335372// Filter column B: show only rows where value > 80
336373const newTable = table .filterRows ({
337374 x: 2 ,
0 commit comments