custom Fast Navigation not working

2 posts, 0 answers
  1. kasi
    kasi avatar
    29 posts
    Member since:
    May 2011

    Posted 07 Jul 2011 Link to this post

    Hi ,
    I m using RadCalendar which is a MultiViewRows , and I am navigating Some Custom Date Selection when we click the Fast navigation. I using Client Side event but it throws Date2 must be array: [y, m, d]. Here below i show my code , please suggest me where is error.

    <telerik:RadCalendar runat="server" Skin="Windows7" ID="RadCalendar1" AutoPostBack="true"
                                           TitleFormat="MMM-yy" EnableMultiSelect="false" MultiViewRows="3" MultiViewColumns="1"
                                           PresentationType="Interactive" HideNavigationControls="true" DayNameFormat="FirstTwoLetters"
                                           ShowOtherMonthsDays="false" FastNavigationStep="1" EnableNavigation="true" EnableMonthYearFastNavigation="False">
                                           <ClientEvents OnCalendarViewChanged="CheckSelections" />
                                       </telerik:RadCalendar>
    function CheckSelections(sender, eventArgs) {
                var selDates = sender.get_selectedDates();
                var calendar = $find("<%=RadCalendar1.ClientID%>");
                var dates = calendar.get_selectedDates()
                var date = dates[0]
                var year = date[0];
                var month = date[1];
                var day = date[2]
                var mydate = month + "/" + day + "/" + year
                mydate = DateAdd(mydate, "M", 1); 
                var datearray = mydate.format("yyyy, M, d");
                var arr = [datearray];
                calendar.selectDate(arr,true);  
            }
  2. Genti
    Admin
    Genti avatar
    107 posts

    Posted 11 Jul 2011 Link to this post

    Hi Kasi,

    Thank you for contacting us.

    Let's suppose the following:
    -You select one date, then the calendar is going to postback and store this date in the ViewState.
    -Then when you try to get to the next view, set again this date with the function selectDate().
    -This makes the Calendar switch the view again to the same page where the selected date was.
    So, you cannot change your view.

    What is the purpose of this code?

    If you want to use the selectDates function make sure the array that you pass is as following:
    var arr = [[year, month, day]];
    otherwise if you use the selectDate function it should be:
    var arr = [year, month, day];

    Hope this helps.

    Greetings,
    Genti
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top