This is a migrated thread and some comments may be shown as answers.

[Solved] Adding delete button to AdvancedEditForm

3 Answers 152 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mikko Mertanen
Top achievements
Rank 1
Mikko Mertanen asked on 03 Jul 2009, 11:40 AM
Hi

I would like to add a delete button on AdvancedEditForm of the Scheduler. I have update and cancel buttons on the form now and they work nicely. But I would like to add delete there, so I could delete the appointment being edited and then return back to the calendar view. How should I do it so it would have the same functionality as clicking the red 'x' on an appointment from the calendar view? It should display the confirmation dialog and take care of the recurrent appointment deletion and so on.

Mikko

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 06 Jul 2009, 02:49 PM
Hi Mikko Mertanen,

Please find attached a sample project. It uses the deleteAppointmentWithConfirmation method of RadScheduler client object.

Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mikko Mertanen
Top achievements
Rank 1
answered on 07 Jul 2009, 01:21 PM
Hi

Thank you for the answer! I tried the example code you attached. First we needed to upgrade the dll to newest version. After that I could try testing. Now I still have some problems with the visibility of the confirmation box. When I tried the example code, the confirmation box is displayed "behind" the appointment edit window using IE7. With Firefox the dialog was displayed nicely.
But with our actual project we have <AdvancedForm Modal="false" /> and because of that the confirmation dialog is not visible at all with IE7, Firefox or Chrome. I think it's behind the edit window. The same thing happens with the example code is you change the Modal-setting to false. Do you have any ideas how to get the confirmation box to display on top of other controls?
We have similar problem with the scheduler and our menu. The scheduler is always displayed as topmost control and our menu is hidden behind it. This happens with IE7, but works nicely with IE8, Firefox or Chrome.

Thanks,

Mikko
0
Veselin Vasilev
Telerik team
answered on 10 Jul 2009, 12:11 PM
Hi Mikko Mertanen,

You are right. Let's use another approach then - please change the DeleteAppointment javascript method in AdvancedEditForm.ascx as follows:

function DeleteAppointment() 
    var scheduler = $find("<%= Owner.ClientID %>"); 
    var app = scheduler.get_currentAppointment(); 
     
    if (confirm("Are you sure you want to delete this appointment?"))     
    { 
        scheduler.deleteAppointment(app, false); 
        scheduler.hideAdvancedForm(); 
    } 
     
    return false; 

This will use the standard confirm dialog.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Mikko Mertanen
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Mikko Mertanen
Top achievements
Rank 1
Share this question
or