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. Image for the cookie policy date

Warning message when selected row changes

Hi, 
I have a editable grid with editMode = normal. Is it possible to show a warning message when user changes selected row, instead of saving directly?
Thanks
Stefano

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team March 22, 2016 09:05 AM UTC

Hi Stefano,

Thanks for contacting Syncfusion support.

We have achieved your requirement ”Show warning message while save the record” using actionBegin event. This event triggered for every grid action before its starts. We can get the request type and check the condition in this event. If the requestType is save then we have to open the confirmation dialog and bind the two click events for save or cancel the edit operation.
Please refer to the code example, Help document and Sample,

Code Example:

<script>

var temp=false;

              function actionbegin(e){         

               

              if(e.requestType == "save" && temp == false){

               e.cancel=true;

               $("#Dialog").ejDialog("open");

               $("#Grid").addClass('disablegrid');

                          

             

              }

              temp=false;

               }

               

               function click1(args){

               var obj=$("#Grid").ejGrid('instance');

               temp=true;

               obj.endEdit();

               

               $("#Dialog").ejDialog("close");

         $("#Grid").removeClass('disablegrid');

               

               }

               function click2(args){

               

               $("#Dialog").ejDialog("close");

               $("#Grid").removeClass('disablegrid');

               }

               

             

 

Help document: http://help.syncfusion.com/js/api/ejgrid#events:actionbegin

Sample: http://jsplayground.syncfusion.com/3q3hgtah


Regards,
Venkatesh Ayothiraman.

Loader.
Live Chat Icon For mobile
Up arrow icon