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

Custom RecurrenceActionDialog and instance editing

2 Answers 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Cantemir Mihu
Top achievements
Rank 1
Cantemir Mihu asked on 16 Mar 2010, 08:12 AM
Hello,

I want the following: if I double click an appointment, I want a custom Recurrence action dialog. For this I have done the following steps:

1. in OnClientAppointmentDoubleClick I store the ID of the appointment which has been double clicked:
var apt = eventArgs.get_appointment(); 
// store this and use it on the popups OK button click 
$get("doubleClickedAppointment").value = apt.get_id(); 
2. In the OnClientRecurrenceActionDialogShowing I suppress the standard action and show my custom popup:
    eventArgs.set_cancel(true); 
    var modalPopupBehavior = $find('InstanceOrSeriesModalPopupExtender'); 
    modalPopupBehavior.show(); 
 
    return false; 
 
3. In the OnClick event handler of my custom popup's OK button, I use the stored doubleClickedAppointment and want to display the AdvancedEditForm.

But I have some issues:
a. If I double click an instance of a series, the ID received in the double click event handler is the ID of the series appointment, formatted like this: "c5628db3-7446-4550-94eb-62841308404f_0" <--- this is the GUID from the DB and a "_0". What is the "_0"?
b. What is the best way to find the instance of the series on which the user double clicked?
c. How should I call ShowAdvancedEditForm()? What should be the second parameter be based on? If the user chooses to edit the series, then I should pass true, right? Otherwise false.  But then again, what should the first parameter be? The exception appointment, or the series appointment?

Maybe my entire approach is not correct. Is there an easier way to accomplish this behavior?

Best regards,
Cantemir

2 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 19 Mar 2010, 11:04 AM
Hello Cantemir,

I can confirm that your approach is correct. Now to your questions.

You can obtain the appointment directly in the OnClientRecurrenceActionDialogShowing event by calling the eventArgs.get_appointment() function.

The IDs of occurrences are generated by adding suffixes - "_0" for the first occurrence, "_1" for the second and so on. You can ignore that and pass the appointment as it is, RadScheduler will take care of locating the actual appointment that needs to be edited.

So, to summarize
  • Obtain the appointment instance in OnClientRecurrenceActionDialogShowing and cancel the event
  • Display your confirmation dialog
  • Call showAdvancedEditForm with the stored appointment (this can be occurrence as well) as a first argument. The second argument is true when you want to edit all appointments in the series, false to edit only this occurrence.

I hope this helps.
Best wishes,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Cantemir Mihu
Top achievements
Rank 1
answered on 19 Mar 2010, 11:53 AM
Hello,

thanks for the info. I have managed to get it working, thanks for the confirmation of being on the right track.

Regards,
Cantemir
Tags
Scheduler
Asked by
Cantemir Mihu
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Cantemir Mihu
Top achievements
Rank 1
Share this question
or