Combination of inline and batch mode

Hi, 

Thanks for this amazing library. 
I have one question: 
I like the grid to show the editor only on the selected cell (like batch mode) but update the underling data store immediately, when the editor closes (something like inline mode but not exactly).

Is this possible ? Can I hack the batch mode to commit the change immediately on end edit or there is a better way ?

Thanks



4 Replies

PS Pavithra Subramaniyam Syncfusion Team November 21, 2017 12:27 PM UTC

Hi Chriss, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and you can achieve your requirement by using “cellSave” event and “batchSave” method of Grid component. Please refer to the following code example and Document link. 

import { Grid, Edit, Toolbar, Page, Filter, CellSaveArgs } from '../src/grid/index'; 
. . .  
let grid: Grid = new Grid({ 
    dataSource: data, 
    cellSave: save, 
    toolbar: ['add', 'delete', 'update', 'cancel'], 
    editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'batch' }, 
    columns: [ 
                        . . . 
                       . . . 
    ] 
}); 
grid.appendTo('#Grid'); 

function save (args: CellSaveArgs) { 
       grid.editModule.batchSave(); 
} 



We have prepared a sample for your reference that can be downloaded from the following link. 


Regards, 
Pavithra S. 



CK Chriss Kalogeropoulos November 21, 2017 11:21 PM UTC

Thank you very much


CK Chriss Kalogeropoulos November 22, 2017 01:59 AM UTC

I would suggest to add this as another editing option (cell) in one of your next releases.
It is very useful and most grid implementations already have this.
And it is only a couple of lines of code as it seems

Again, thanks


PS Pavithra Subramaniyam Syncfusion Team November 23, 2017 05:22 PM UTC

Hi Chriss, 

Your requirement(“update immediately in batch edit mode – another edit option”) can be achieved by adding simple codes in sample side itself. So that we will provide a UG Documentation for this scenario. The Documentation will be available in any of our upcoming releases. 

Regards, 
Pavithra S. 
 


Loader.
Up arrow icon