We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Batch Confirm

Thread ID:

Created:

Updated:

Platform:

Replies:

143578 Mar 27,2019 03:26 PM UTC Mar 29,2019 01:32 PM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Miguel Varela Rodriguez
Asked On March 27, 2019 03:26 PM UTC

Hi Syncfusion Team,

i have a Data grid with editmode : Batch.

When i push the "update" button on the tool bar i get a confirm dialog, how can i get the result from this dialog?

Thank you in advance.

regards Miguel Varela

Thavasianand Sankaranarayanan [Syncfusion]
Replied On March 29, 2019 01:32 PM UTC

Hi Miguel, 

Thanks for contacting Syncfusion support. 

We have validated your requirement  and your can get changes/ added record from ‘getBatchChanges’ method of Grid. Please find the code example 


gridObj.editModule.getBatchChanges() 



For batch editing we have added class  as ‘e-updatedtd’  for each update/added cells. Please find the code example for your reference. 


 




You can customize the confirmation dialog  through toolbarClick and dialogOpen event of Grid. Please find the code  example and sample for your reference. 





import { enableRipple } from '@syncfusion/ej2-base'; 
enableRipple(true); 

import { Grid, Toolbar, Edit, Page } from '@syncfusion/ej2-grids'; 
import { orderData } from './data-source'; 

/** 
* Batch Editing sample 
*/ 
Grid.Inject(Edit, Toolbar, Page); 



let grid: Grid = new Grid( 
  { 
    dataSource: orderData, 
    editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Batch' }, 
    toolbarClick: (args) => { 
      if (args.item.text === 'Update') { 
        (grid.editModule as any).dialogObj.beforeOpen = dlgOPen 
      } 
    }, 
    pageSettings: { pageCount: 5 }, 
    toolbar: ['Add', 'Delete', 'Update', 'Cancel'], 
. . . 

function dlgOPen(args) { 
 
  let div = document.createElement('div'); 
  this.contentEle.append(div); 
  if ((grid.editModule.getBatchChanges() as any).addedRecords.length) { 
    let span = document.createElement('span'); 
    span.innerHTML = 'added : ' + JSON.stringify((grid.editModule.getBatchChanges() as any).addedRecords); 
    div.appendChild(span); 
  } 
.. . 
  } 
  this.width = 'auto' 





This is not meet your requirement could you please explain and share more details , screenshot  about  requirement. 


Regards, 
Thavasianand 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;