Trying to open New appointment from Client side

6 posts, 0 answers
  1. Sanjeev Bora
    Sanjeev Bora avatar
    15 posts
    Member since:
    Jan 2010

    Posted 07 May 2011 Link to this post

    Hi,
     I was trying to use Client side script as suggested from here
    http://www.telerik.com/community/forums/aspnet-ajax/scheduler/opening-the-new-appointment-form-and-pre-populating-fields.aspx

    to open a new Appointment by clicking as button. However I get the Javascript error as follows ..

    Uncaught TypeError: Cannot call method 'getTimezoneOffset' of null
    I am able to create "New appointment" from the context menu of the Scheduler control. But not from a button outside. Please suggest.

    Thanks
    Sanjeev
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 09 May 2011 Link to this post

    Hi Sanjeev Bora,

    I am able to create new appointment via button-click without receiving any Javascript error. Please take a look at the video that I made for you to show you what I got as a result on my side.

    Could you please show me the settings of your RadScheduler please?

    Regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Sanjeev Bora
    Sanjeev Bora avatar
    15 posts
    Member since:
    Jan 2010

    Posted 09 May 2011 Link to this post

    Hi Veronica,
    Here is the RadScheduler Block.
    <telerik:RadScheduler  ID="RadScheduler1"  runat="server" AppointmentStyleMode="Simple"
               AdvancedForm-Enabled="true" AdvancedForm-Modal="true"  AllowDelete="true" AllowEdit="true" AllowInsert="true"
               DataDescriptionField="DESCRIPTION" DataEndField="TO_DATE" DataKeyField="EVENTID"
               DataStartField="FRM_DATE" DataSubjectFielD="SUMMARY"  DisplayDeleteConfirmation="true" EnableAdvancedForm="true"
               EnableDescriptionField="true" EnableRecurrenceSupport="true" EnableEmbeddedScripts="true"  Localization-ContextMenuAddAppointment="Add event"
               Localization-ContextMenuAddRecurringAppointment="Add recurring event"
                EnableExactTimeRendering="true" DataRecurrenceField="RECURRENCE_RULE"   
               DataRecurrenceParentKeyField="RECURRENCE_PID"   RegisterWithScriptManager="true" StartEditingInAdvancedForm="true"
               StartInsertingInAdvancedForm="true" TimeSlotContextMenuSettings-EnableDefault="True"
               SelectedView="MonthView" Skin="Forest" DataSourceID="datasource1"
               OverflowBehavior="Expand"   
               WorkDayStartTime="08:00" WorkDayEndTime="18:00"
                     MinutesPerRow="30" HoursPanelTimeFormat="HH:mm tt" OnFormCreated  ="RadScheduler1_FormCreated"
                  OnClientAppointmentContextMenuItemClicked="appointmentContextMenuItemClicked"
           >
             
             <AppointmentContextMenus>
             <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                       <Items>
                           <telerik:RadMenuItem Text="Open" Value="CommandEdit"   />
                           <telerik:RadMenuItem Text="Manage alerts"/>
                           <telerik:RadMenuItem IsSeparator="True" />
                           <telerik:RadMenuItem Text="Delete" Value="CommandDelete"/>
                       </Items>
                   </telerik:RadSchedulerContextMenu>
             </AppointmentContextMenus>
              <ResourceTypes>
                    <telerik:ResourceType KeyField="CATID" Name="Category" TextField="Category" ForeignKeyField="CATEGORY_ID"
                        DataSourceID="catdatasource" />
                     
                </ResourceTypes>
     
            <TimeSlotContextMenus>
                   <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
                       <Items>
                           <telerik:RadMenuItem Text="New Event"   Value="CommandAddAppointment" />
                           <telerik:RadMenuItem Text="New Recurring Event"   Value="CommandAddRecurringAppointment" />
                           <telerik:RadMenuItem IsSeparator="true" />
                           <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" />
                       </Items>
                   </telerik:RadSchedulerContextMenu>
            </TimeSlotContextMenus>
           
          </telerik:RadScheduler>
  4. Sanjeev Bora
    Sanjeev Bora avatar
    15 posts
    Member since:
    Jan 2010

    Posted 10 May 2011 Link to this post

    Please help us out, a little critical here.

    Thanks
    Sanjeev
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 11 May 2011 Link to this post

    Hello Sanjeev Bora,

    Thank you for the RadScheduler settings provided.

    The problem was because you set the selected view of the RadScheduler to "MonthView". Please note that  when you create appointments in "MonthView" and "TimelineView" they will be always all-day appointments. Instead of using the showAllDayInlineInsertForm in the button click handler you can use the showAdvancedInsertForm:

    function insertAppointment() {
                var now = new Date();
                var scheduler = $find("<%= RadScheduler1.ClientID %>");
                scheduler.showAdvancedInsertForm(now);
            }

    Please test it and let me know how it goes.

    Kind regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Sanjeev Bora
    Sanjeev Bora avatar
    15 posts
    Member since:
    Jan 2010

    Posted 11 May 2011 Link to this post

    Perfect! it worked...
    Thanks very much
    Sanjeev
Back to Top