search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How do I get the in-built UI functionality for editing recurrence events restored after not using inbuilt functionality?

Asked by mrplatypus
6 years ago.

Hi Dan and Team,

In the post:
https://forums.daypilot.org/Topic.aspx/3089/i-would-also-like-to-allow-the-users-to-edit-the-recurring-
I would like the users to be able to edit the recurring event ...

My issue is that on entering the RecurrenceEventEdit.aspx page the javascript:

<script type="text/javascript">
var r = new DayPilot.Recurrence();
r.saveButtonId = "ButtonSave";
r.jsonHiddenId = "Recurrence";
r.config = <%= RecurrenceJson %>;
r.Init();
</script>

... sets the config of the recurrence event to "Recurrence" (the jsonHiddenId property)

I am no longer using the provided inbuilt functionality ..
When the page is loaded the "Repeat" drop down list contains the value, "Does not repeat", and the control seems to be disabled..

How do I get the in-built UI functionality for editing recurrence events restored?

Comment posted by mrplatypus
6 years ago.

Hi Dan and Team,

I am really hoping that you can provide a solution with me here..

Thanks

Dave/mrplatypus

Answer posted by Dan Letecky [DayPilot]
6 years ago.

Dave,

You need to store the rule definition with the master record even if you don't let DayPilot to expand it automatically. You will need it just for this case - to know how the rule was defined so you can edit it later.

No changes of UI dialog are needed, just supply the rule using the original RecurrenceJson code.

Comment posted by mrplatypus
6 years ago.

Dan,

Apologies for my confusion:
I am under the impression that if the master record has its data item (rule) populated and set in the control then that rule would be expanded?

Please advise how I would tell DayPilot not to expand it automatically?

Dave

Comment posted by mrplatypus
6 years ago.

Dan,

I've just proven my statement above, in that if the recurrence rule data item is populated that the event is automatically expanded - I now have two events displayed in the control ..

Dave

Comment posted by Dan Letecky [DayPilot]
6 years ago.

It is only expanded if you specify DataRecurrenceField property.

1. You have to store the rule somewhere so you can access it later.
2. But don't ask DayPilot to expand it automatically. It will only be expanded automatically if you specify DataRecurrenceField.

See also item #6 in my answer to this question:
http://forums.daypilot.org/Topic.aspx/3053/example-of-storing-recurring-events-as-separate-records-ple

Comment posted by mrplatypus
6 years ago.

Dan,

>>It is only expanded if you specify DataRecurrenceField property.
>>1. You have to store the rule somewhere so you can access it later.

Further to the same posting to which you refer, I have added new data fields to store the values you have identified.

>>2. But don't ask DayPilot to expand it automatically. It will only be expanded automatically if you specify DataRecurrenceField.

Unfortunately, I am in the position where I have events that currently use the inbuit mechanism - I am aiming to step from that to the manual way, so I will need the DataRecurrenceField for the old events.

======

In retrospect to my original question maybe that ought to be changed slightly to take into account the mixed scenario that the database currently is in:

How do I get the in-built UI functionality for editing recurrence events back, since the development system in being in transition from inbuilt way to manual way of dealing with events so that the application would be scalable?

Comment posted by Dan Letecky [DayPilot]
6 years ago.

In that case you can store it in another field.

Comment posted by mrplatypus
6 years ago.

Dan,

Apologies, I am storing the encoded recurrence rule in a different field, this was in addition to your answer specified:
http://forums.daypilot.org/Topic.aspx/3053/example-of-storing-recurring-events-as-separate-records-ple

How may I use the two different modes of working, the inbuilt automatic method <i>and</i> the manual way to allow the user to edit the event rule? is it possible?

Regards

Dave/mrplatypus

Comment posted by Dan Letecky [DayPilot]
6 years ago.

It might be possible:

1. If you store the the recurrence for fields that you want to be expanded automatically in field1 and use DataRecurrenceField="field1".
2. The recurrence for fields that you expand manually must be stored in a different field, e.g. field2.

I'm sorry but we have gone far from what is a supported scenario. I might be able to give hints on how to approach certain problems I'm not able to provide the complete solution.

And that the hints are just that - hints on where to start. The recurrence is not trivial and as you progress deeper and deeper you hit harder and harder problems.

So asking "is xy possible" is a tricky question. In some cases the answer is yes, it is possible. But that is different from "it is a good idea" or "it is easy".

Even the built-in recurrence is not an easy setup (if you decide to support exceptions from the recurrence rules). The recurrence support is designed for this scenario - it brings some compromises in order to make it easier.

Switching to manual handling exposes these limits. So at this point it's good to ask whether to stay with the DayPilot recurrence support or whether to choose another solution for defining the rules and expanding the occurrences. With manual expanding you are not bound to using the built-in support and you can replace it with any other implementation.

And the next step, adding mixed support for both the built-in recurrence and manually handled recurrence complicates that even more - and you need to evaluate your architecture from that point of view. It is possible that it will handle it but it might not be the case.

So I apologize for not being supportive but we have drifted into area which I'm not able to back.

Comment posted by mrplatypus
6 years ago.

Dan,

Very many many thanks for your support and hints with this.
Your time into this matter has been gratefully received.

Regards

Dave/mrplatypus

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.