ejs2 grid Inline Editing without clicking on update button

Hi , I have a ejs-grid . I want to do inline editing of rows and rather than clicking on Update , i want to call jquery to update grid elements. Is it possible.


1 Reply

JC Joseph Christ Nithin Issack Syncfusion Team August 9, 2021 01:38 PM UTC

Hi Pradnya,  
  
Greetings from Syncfusion support.  
  
Based on the query we suspect that your requirement is to cancel the default Grid edit and perform your own update action without clicking the ‘update’ button. If so, we would like to let you know that on clicking out of the current edit row(inside the Grid), the Grid’s save action will be triggered and the actionBegin event will be triggered where the updated row data will be returned as shown in the below image,  
  
   
  
From here you can cancel the default ‘save’ action by setting the event arguments ‘cancel’ property to ’true’ as demonstrated in the below code snippet,  
  
// Grid’s actionBegin event handler  
function actionBegin(args) {  
    if (args.requestType === 'save') {  
        // The default save action will be cancelled. Here you can perform your own update action with the modified data  
        args.cancel = true;  
    }  
}  
  
Also for saving the record on clicking outside the Grid, you can achieve it by binding click event to the document where you can save the edited record by calling the Grid’s endEdit method. This is demonstrated in the below code snippet,  
  
document.addEventListener('click'function (args) {  
         var grid = document.getElementById('Grid').ej2_instances[0];  
        // Check if any row is in edit mode  
        if (grid.isEdit) {  
                // Saves the edited record  
                grid.endEdit();  
        }  
});  
  
                  https://ej2.syncfusion.com/documentation/api/grid/#endedit  
  
If we misunderstood your query or if you require any further assistance, then please get back to us.  
  
Regards,  
Sujith R  
 


Loader.
Up arrow icon