@@ -284,6 +284,63 @@ const schema = {
284284- Spreadsheet-like editing experience
285285- Real-time updates with backend synchronization
286286
287+ ### Batch Editing & Multi-Row Save
288+
289+ Edit multiple cells across multiple rows and save them individually or all at once:
290+
291+ ``` typescript
292+ const schema = {
293+ type: ' object-grid' ,
294+ objectName: ' products' ,
295+ columns: [
296+ { header: ' SKU' , accessorKey: ' sku' , editable: false },
297+ { header: ' Name' , accessorKey: ' name' },
298+ { header: ' Price' , accessorKey: ' price' },
299+ { header: ' Stock' , accessorKey: ' stock' }
300+ ],
301+ editable: true ,
302+ rowActions: true , // Show row-level save/cancel buttons
303+ onRowSave : async (rowIndex , changes , row ) => {
304+ // Save a single row
305+ console .log (' Saving row:' , rowIndex , changes );
306+ await dataSource .update (row .id , changes );
307+ },
308+ onBatchSave : async (allChanges ) => {
309+ // Save all modified rows at once
310+ console .log (' Batch saving:' , allChanges );
311+ await Promise .all (
312+ allChanges .map (({ row , changes }) =>
313+ dataSource .update (row .id , changes )
314+ )
315+ );
316+ }
317+ };
318+ ```
319+
320+ ** Batch Editing Features:**
321+ - ** Pending changes tracking** : Edit multiple cells across multiple rows before saving
322+ - ** Visual indicators** :
323+ - Modified rows are highlighted with amber background
324+ - Modified cells are shown in bold with amber text
325+ - Toolbar shows count of modified rows
326+ - ** Row-level actions** : Save or cancel changes for individual rows
327+ - ** Batch operations** :
328+ - "Save All" button to save all modified rows at once
329+ - "Cancel All" button to discard all pending changes
330+ - ** Flexible callbacks** :
331+ - ` onRowSave ` : Called when saving a single row
332+ - ` onBatchSave ` : Called when saving multiple rows at once
333+ - ` onCellChange ` : Still called for immediate cell updates (legacy support)
334+
335+ ** Example Workflow:**
336+ 1 . User edits multiple cells across different rows
337+ 2 . Modified rows are visually highlighted
338+ 3 . Toolbar shows "X rows modified" with Save All/Cancel All buttons
339+ 4 . User can:
340+ - Save individual rows using row-level save button
341+ - Save all changes at once using "Save All" button
342+ - Cancel individual row changes or all changes
343+
287344## TypeScript Support
288345
289346``` typescript
0 commit comments