Add new record after saving

Hello,

How can programmatically invoke the add new record after saving another record?


Code is as follows


<ejs-grid id="grid" actionBegin="actionBegin_" actionComplete="actionComplete"></ejs-grid>


function actionComplete(pageArgs) {

if(pageArgs.requestType=== 'add'){

var grid = document.getElemetById('grid');

grid.ej2_instances[0].addRecord();

}

}



1 Reply

BS Balaji Sekar Syncfusion Team December 7, 2021 05:02 AM UTC

Hi Andrew, 

Greetings from the Syncfusion support. 

Based on your query we suspect that you want to add a new record while save another record since we suggest you to use actionComplete event with “save” requestType. 

Please refer the below code example for more information. 

   Function actionComplete(args) { 
    if (args.requestType == 'save') { 
      this.addRecord(); // Add a new record when save the another record 
    } 
  }, 

Please get back to us, if you need further assistance. 

Regards, 
Balaji Sekar

Loader.
Up arrow icon