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

Recurring events not sending id to template

5 Answers 140 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jackie
Top achievements
Rank 1
Jackie asked on 30 Jun 2017, 06:26 PM

I'm currently using a template in my scheduler, and have a button in it that depends on the id of a particular event. This works fine for single events, but I'm running into issues with recurring events. For recurring events, the id is passed to the first instance of the event shown in the scheduler, but 0 is passed to subsequent instances. This seems strange to me since all other fields (like "title") are passed to every instance. This breaks my button, as it relies on that id.

I've attached a screen shot showing the behavior. You can see that, for the recurring events, the title is displayed for every instance, but the id becomes 0 after the first instance.

Can someone explain this behavior to me? Is there a way I can get the event id to be passed to every instance of a recurring event to be used by my template?

 

5 Answers, 1 is accepted

Sort by
0
Jackie
Top achievements
Rank 1
answered on 30 Jun 2017, 06:27 PM
Sorry, forgot the screen shot.
0
Jackie
Top achievements
Rank 1
answered on 30 Jun 2017, 06:31 PM
Sorry, I'm getting an error when I try to save an attachment. Here's a link to the screen shot: http://imgur.com/LZlPxOn
0
Ivan Danchev
Telerik team
answered on 04 Jul 2017, 01:24 PM
Hello Jackie,

By design a recurring event's instances (occurrences) have id set to 0. The recurring event itself (series) has a unique id. You can observe this in the edit event handler: sample dojo. For example if you scroll down and double click a "Dance Practice" occurrence and choose to edit only the occurrence the id will be 0 whereas recurrenceId will return 95. Choosing the "Edit the series" option will log the event's id as 95 and recurrenceId will be null. In short non-recurring events can be identified by id whereas occurrences can be identified by their recurrenceId.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jackie
Top achievements
Rank 1
answered on 05 Jul 2017, 05:47 PM

Hi Ivan,

It looks like I am able to get the same behavior you're showing in your example by console logging both of the ids. However, it seems like the recurrenceId isn't being set until the editor is opened, and is still equal to 0 in the template (I've attached a screenshot illustrating this). This means that I can't use the recurrenceId as an id for my button in my template.

To give you some more background, we're using the scheduler to store short news stories that will be displayed on a scheduled date. The button I have in my template allows users to preview what the story will look like. Since this depends on an id, the preview is currently working for non-recurring events, as well as the first occurrence for recurring events. It, however, is not working for subsequent occurrences because the id is 0.

Can you think of any other ways I might be able to identify which story goes with subsequent occurrences of an recurring event?

Thank you for your help!

0
Ivan Danchev
Telerik team
answered on 06 Jul 2017, 02:22 PM
Hi Jackie,

In the event template you can use the event fields (title, description, etc.) including id and recurrenceId. If a recurring event already exists it will have those fields and they can be displayed in the template, i.e. you don't need to edit an event for them to be set. As for adding a new recurring event, as I mentioned, after it is saved it gets an id and its occurrences get this id as a recurrenceId. See this dojo example modified with event template added. Scroll down to 6pm: there are two occurrences of Dance Practice and two occurrences of HR Lecture. Only the first occurrence of these recurring events have an id (TaskId) - 95 and 25 respectively and they don't have recurrenceId, their next occurrences have TaskId=0 and they have the respective value (95 or 25) set as their recurrenceId. If you create a new recurring event it will again behave the same way: the first occurrence will have id, the next occurrences will have 0 id and the first occurrence id set as recurrenceId.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
Jackie
Top achievements
Rank 1
Answers by
Jackie
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or