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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Confirm Delete

Thread ID:

Created:

Updated:

Platform:

Replies:

131948 Aug 4,2017 11:49 AM UTC Aug 9,2017 04:18 AM UTC ASP.NET Web Forms 3
loading
Tags: Gantt
Martin Sickel
Asked On August 4, 2017 11:49 AM UTC

Hi I am trying to add a confirm delete box 

If i add a confirm dialog to the ActionComplete event

 if (confirm("Are you sure ? ")) { 
                        PageMethods.DeleteIt(ganttRec, onSucceeded, onFailed);
                        if (data.hasChildRecords) {
                            deleteChildRecords(data);
                        }
          }

The Confirm Dialog is popping up and if I select cancel the delete is not synced to DataBase, but unfortunatly the GUI itself is updated and the Task is deleted in the view.
After reloading the page by getting the data out of the DB its fine.

How can I avoid that the view will be updated with the deleted record?

Or is there maybe a build in delete confirm Dialog?


Thanks for help
Martin




Suriyaprasanth Ravikumar [Syncfusion]
Replied On August 7, 2017 12:33 PM UTC

Hi Martin, 
 
Please find the response below.  
 
The “ActionComplete” client side event for delete action was triggered only after the successful completion of delete operation. 
Hence the confirmation dialog was not working properly. We can achieve your requirement by using “ActionBegin” client side event. 
Please refer the following code snippet,  
[ASPX] 
<ej:Gantt ID="GanttControlResource" ActionBegin="ActionBegin" ActionComplete="ActionComplete"> 
</ej:Gantt> 
<script type="text/javascript"> 
            function ActionBegin(args) { 
                    if (args.requestType === 'delete' && !confirm("Are you sure ? ")) 
                        args.cancel = true; 
            } 
            // To update the database through dialog editing or tool bar editing 
            function ActionComplete(args) { 
                // Sql delete operations 
            } 
        </script> 
 
We have also prepared a sample for your reference, please find the sample location as below, 
Thanks, 
Suriyaprasanth R. 


Martin Sickel
Replied On August 8, 2017 07:36 AM UTC

Thank you for the great Support.

Martin


Jayakumar Duraisamy [Syncfusion]
Replied On August 9, 2017 04:18 AM UTC

Hi Martin, 
Thanks for the update. 
Regards, 
Jayakumar D 


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.

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

;