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

Need Permanent Recurrence Indexing, Not Based on View

1 Answer 41 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Veteran
Chris asked on 29 Jul 2015, 06:04 PM

I have a RadScheduler instance on a DNN UserControl. The back end of the control feeds data called Alerts into the scheduler. Most alerts are intended to be recurring, usually once a week or semi-weekly, etc.

 

<div class="My_Container">
    <div class="My_Calendar">
        <telerik:RadScheduler ID="alertRadScheduler" runat="server" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
            Skin="Metro" Height="450" OverflowBehavior="Auto" AllowInsert="False" AllowEdit="False"
            SelectedView="MonthView" ShowFooter="false" EnableRecurrenceSupport="True"
            DayStartTime="08:00:00" DayEndTime="21:00:00" FirstDayOfWeek="Sunday" LastDayOfWeek="Saturday" OnClientFormCreated="schedulerIsCompleted"
            EnableDescriptionField="true" AppointmentStyleMode="Simple" EnableCustomAttributeEditing="True" CustomAttributeNames="IsComplete, CompletedRecurrences2"
            OnClientAppointmentClick="OnClientAppointmentClick" OnClientAppointmentInserting="OnClientAppointmentInserting">
            <Localization AdvancedEditAppointment="Edit Alert" AdvancedNewAppointment="New Alert" />
            <AppointmentTemplate>
                <div class="My_CalendarAlert">
                    <a ng-click="(<%# Eval("Id").ToString().Split('_')[0] %>)"
                        data-recid="<%# Eval("Id").ToString().Split('_').Length > 1 ? Eval("Id").ToString().Split('_')[1] : "" %>">
                        <span class="ball"></span><%# Eval("Subject") %>
                    </a>
                </div>
            </AppointmentTemplate>
            <InlineInsertTemplate>
            </InlineInsertTemplate>
        </telerik:RadScheduler>
    </div>
</div>

As you can see in the block, I have default Monthly view and how we do add/edit options etc. The end result of how the Alert (Appointment) looks on the calendar days themselves is a red or green square followed by the name (cut off if the name is too long to fit in the box). You click the Alert to open a custom editor. The choice between Red and Green square is based on a 'Completed Reccurences' list for the user which says that for a given Alert, recurrence indexes X,Y,Z are Completed if they are present in that Completed list. Completed are Green, the rest are Red.

Now all of this has been working to set up recurrences by generating the rules, etc. and we just now figured out that the Recurrence Indexes are based on the Monthly View that you are currently looking at. We were expecting that if something started on X date and recurred weekly, then 2 months later the indexes should be somewhere like 8-12, but they are not.

For instance, we have a recurrence set to start on Friday, July 3rd on a weekly basis. It shows up every Friday like intended. The user has 'completed' the Recurrences that are on the 3rd, 10th, 17th and 24th of July (these are in green), but not the 31st (this one is in red). That is all working as expected.

https://i.gyazo.com/224f03a5e3fa90ed5e39e46506d66659.png

However, we jump to the next month, August. No recurrences have been completed for this month (since that is in the future​) and here is what we see:

https://i.gyazo.com/94a6136e9c79bfe006f9a5a084543eba.png

The indexes, starting from July 31st (the fifth instance) are reset to start from ​0. Since I have 'Completes' recorded for "",0,1,2 it's marking those as complete in the UI. However since these are instances that should be starting with "3" on the 31st, I should be seeing 3,4,5,6,7 in the month of August.

If this were related to what Month it was, where in the index was reset at the beginning of the month and the 7th of August (the first Friday to contain the Alert), I could handle that by adding the Month to my database and call it part of the unique id. But with it based on whatever view the user is looking at I can't reliably do that.

What can I do to fix this? I need permanent indexing based on when the recurrence rule actually started, not based on the view the user is looking at on the page.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 31 Jul 2015, 09:46 AM
Hi,

The behavior that you are observing is expected and this generation of the recurrence appointments can not be changed because this is how the control is designed to work from the beginning.

One other possible way to implement the desired functionality, instead of using the mark up in the template is to use the AppointmentCreated event that is triggered just after the control is rendered and from there to manipulate the controls in the template as for example it is done in this online demo.

Hope this will help you solve the issue.

Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Chris
Top achievements
Rank 2
Veteran
Answers by
Plamen
Telerik team
Share this question
or