Run JS on Editable Grid row delete

0
27
Role Image


Normally when record is created or deleted, the subgrid will refresh so I register a event when grid refresh

Try this.

function mainForm(executionContext) {

   var formContext = executionContext.getFormContext();

   //add event when grid is refresh after add or delete a record

   formContext.getControl(‘subgrid logical name’).addOnLoad(function(formContext){

       //total record present in grid before delete

       var totalRecord = formContext.getControl(“subgrid logical name”).getGrid().getTotalRecordCount();

       //Check row is deleted or not

       //if deleted then perform js

       if(formContext.getControl(“subgrid logical name”).getGrid().getRows().get()[totalRecord-1] == undefined){

           //action

       }

   });

}



Source link

Leave a reply

Please enter your comment!
Please enter your name here