Advanced Form Template and Recurrence Rule Editor

8 posts, 0 answers
  1. Konrad
    Konrad avatar
    9 posts
    Member since:
    Nov 2010

    Posted 25 Mar 2011 Link to this post

    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
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 25 Mar 2011 Link to this post

    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
  3. Konrad
    Konrad avatar
    9 posts
    Member since:
    Nov 2010

    Posted 28 Mar 2011 Link to this post

    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?
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 28 Mar 2011 Link to this post

    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
  5. Konrad
    Konrad avatar
    9 posts
    Member since:
    Nov 2010

    Posted 29 Mar 2011 Link to this post

    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();
                    }
                     
                }
  6. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 30 Mar 2011 Link to this post

    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
  7. Konrad
    Konrad avatar
    9 posts
    Member since:
    Nov 2010

    Posted 31 Mar 2011 Link to this post

    Hi Veronica,

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

    Regards,
    Konrad
  8. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 31 Mar 2011 Link to this post

    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
Back to Top