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

Advanced Form Template and Recurrence Rule Editor

7 Answers 196 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Konrad
Top achievements
Rank 1
Konrad asked on 25 Mar 2011, 01:25 PM
Hi,

I am using a Scheduler setup as demonstrated in http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx

Our users are complaining that when making an "all day" recurring appointment, they can still select "hourly" from the recurrence rule editor (see attached screen shot)

Is there any workaround to this?


Best Regards,
Konrad

7 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 25 Mar 2011, 01:55 PM
Hi Konrad,

This is not a bug in our control. You can choose to create all-day appointments which occur each 1 hour. However there will be some overlapping of appointments in this case. Please take a look at this KB article for how to workaround this.

However if you still don't want the "Hourly" option in the RecurrenceEditor of the Advanced Form - you can subscribe to the OnClientFormCreated event and use the following code in the handler:

function OnClientFormCreated(sender, eventArgs) {
          $telerik.$(".rsRecurrenceOptionList li:first-child").hide();
      }

Hope this helps.

Regards,
Veronica Milcheva
the Telerik team
0
Konrad
Top achievements
Rank 1
answered on 28 Mar 2011, 09:29 AM
How would I hide the "Hourly" option only when "All Day" is selected.
If they deselect "All Day" it must show the "Hourly" option again if it is a recurring appointment.

Is this possible?
0
Veronica
Telerik team
answered on 28 Mar 2011, 10:13 AM
Hi Konrad,

Yes, you can check whether the allday checkbox is checked and only then to hide the "Hourly" option from the recurrence editor. Here's the code for this:

function OnClientFormCreated(sender, args) {
           var $ = $telerik.$;
           if ($('input[name=RadScheduler1$Form$AllDayEvent]').is(':checked'))
           {
               $(".rsRecurrenceOptionList li:first-child").hide();
           }
       }

Please let me know if this was helpful.

Regards,
Veronica Milcheva
the Telerik team
0
Konrad
Top achievements
Rank 1
answered on 29 Mar 2011, 04:21 PM
Hi Veronica,

Sorry for the long delay. I tried the code you provided but it didn't have any effect.

Here is what my client-side function looks like:

function onClientFormCreated(scheduler, eventArgs) {
                // Create a client-side object only for the advanced templates
                var mode = eventArgs.get_mode();
                if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert || mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
                    // Initialize the client-side object for the advanced form
                    var formElement = eventArgs.get_formElement();
                    var templateKey = scheduler.get_id() + "_" + mode;
                    var advancedTemplate = schedulerTemplates[templateKey];
                    if (!advancedTemplate) {
                        // Initialize the template for this RadScheduler instance and cache it in the schedulerTemplates dictionary
                        var schedulerElement = scheduler.get_element();
                        var isModal = scheduler.get_advancedFormSettings().modal;
                        advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
                        advancedTemplate.initialize();
 
                        schedulerTemplates[templateKey] = advancedTemplate;
 
                        // Remove the template object from the dictionary on dispose.
                        scheduler.add_disposing(function () {
                            schedulerTemplates[templateKey] = null;
                        });
                    }
 
                    // Are we using Web Service data binding?
                    if (!scheduler.get_webServiceSettings().get_isEmpty()) {
                        // Populate the form with the appointment data
                        var apt = eventArgs.get_appointment();
                        var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
                        advancedTemplate.populate(apt, isInsert);
                    }
                }
 
                var $ = $telerik.$;
                if ($('input[name=RadScheduler1$Form$AllDayEvent]').is(':checked')) {
                    $(".rsRecurrenceOptionList li:first-child").hide();
                }
                 
            }
0
Veronica
Telerik team
answered on 30 Mar 2011, 03:57 PM
Hello Konrad,

Could you please send me your full project so I can inspect it and help you? Have you customized the Advanced Form? 

Best wishes,
Veronica Milcheva
the Telerik team
0
Konrad
Top achievements
Rank 1
answered on 31 Mar 2011, 09:13 AM
Hi Veronica,

Where can I send it, I can't attach any .zip files here...

Regards,
Konrad
0
Veronica
Telerik team
answered on 31 Mar 2011, 12:07 PM
Hi Konrad,

Could you please open new Support thread so you can be able to attach .zip files.

Thank you!

All the best,
Veronica Milcheva
the Telerik team
Tags
Scheduler
Asked by
Konrad
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Konrad
Top achievements
Rank 1
Share this question
or