In our application we are using Infragistics Webcalender control to maintain user’s appointments.
Application is having refresh button in each and every page which uses location.Reload() function to
refresh the page.
In the calendar control with monthview,
1) navigate to previous month or next month and
2) click on refresh button(which uses location.Reload())
3) popup dialog window Retry/Cancel.
4) click on cancel button in the dialog,monthview is defaulted to current Month irrespective
of the navigation done.
Can we control this behavior?
Ideally it should go to next or previous month depending onthe navigation.
This behavior is not happening on Browser’s refresh. Only happening in location.reload().
Hello Abhijeet_Rajwade,
For the WebMonthView you can obtain the current month by using the following:
var webMonthView = ig_getWebControlById("WebMonthView1"); var currentMonth = webMonthView.getCurrentMonth();
This will allow you to get the current month of the WebMonthView control. Also you can store the current month in a Hidden server side control. This will allow you to persist between postbacks.
Theoretically you could create a dialog to proceed on whether you would like to stay on the current month or go back to the previous month that is stored in the Hidden input control.
Let me know if you have any questions with this matter. Thank you.
Hi,
Could you give me more complete example. I cannot get this ig_getWebControlById
to return anything? Microsoft JScript runtime error: Unable to get value of the property 'getCurrentMonth': object is null or undefined
Actually what I need is current month number so I can reload just that months calendar view, because we will have 1800 events in 6 months time and WebMonthView1 takes put to 10 seconds to load them and that is too much…
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %>
<%@ Register Assembly="Infragistics4.WebUI.WebSchedule.v12.1, Version=12.1.20121.2048, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="ig" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<ig:WebScheduleInfo ID="WebScheduleInfo1" runat="server" StyleSetName=""
StyleSetPath="" StyleSheetDirectory="">
</ig:WebScheduleInfo>
<ig:WebMonthView ID="WebMonthView1" runat="server"
WebScheduleInfoID="WebScheduleInfo1">
</ig:WebMonthView>
<script type="text/javascript" >
var webMonthView = window.ig_getWebControlById("WebMonthView1");
var currentMonth = webMonthView.getCurrentMonth();
</script>
Hello Mauri Korhonen,
To get the monthview can be done under Initialize. The following can be added in ClientEvents and also the function within the header. E.g.:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <script type="text/javascript" id="igClientScript"> <!-- function WebMonthView1_Initialize(oMonthView){ var webMonthView = window.ig_getWebControlById("<%= WebMonthView1.ClientID %>"); var currentMonth = webMonthView.getCurrentMonth(); } // --> </script></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <ig:WebScheduleInfo ID="WebScheduleInfo1" runat="server" StyleSetName="" StyleSetPath="" StyleSheetDirectory=""> </ig:WebScheduleInfo> <ig:WebMonthView ID="WebMonthView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> <ClientEvents Initialize="WebMonthView1_Initialize" /> </ig:WebMonthView></asp:Content>
function WebMonthView1_Initialize(oMonthView){ var webMonthView = window.ig_getWebControlById("<%= WebMonthView1.ClientID %>"); var currentMonth = webMonthView.getCurrentMonth(); } // --> </script></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <ig:WebScheduleInfo ID="WebScheduleInfo1" runat="server" StyleSetName=""
</ig:WebScheduleInfo> <ig:WebMonthView ID="WebMonthView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> <ClientEvents Initialize="WebMonthView1_Initialize" /> </ig:WebMonthView></asp:Content>
When using master pages you can use the ClientID property in the parameter and calling ig_getWebControlById. By handling the Initialize event also provides the monthview, to get the current month you can call oMonthView.getCurrentMonth().