Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
SelectionChanging won't work
posted

I had a problem in SelectionChanging event. Once I select a date on calendar the event triggered fine. But when I click the same day on second time, the event won’t work. Pl helps me to solve this.

Parents
  • 24497
    Suggested Answer
    posted

    Hi Hasithi,

    That is correct if day already selected, then on mouse click for same day no selection is changed and therefore no-selection-change will be raised. Otherwise it would be a bug. If you need to check if selected date was clicked, then I can suggest you to process mouse event, check which day was clicked and check if that day was already selected. Below is example:

    <script type="text/javascript">
    function calendarMouseDown(cal, args)
    {
      var id = cal.idFromMouse(args.get_browserEvent());
      if(id < 0 || id > 41)
       return;
      var day = cal.get_days()[id];
      if(day.isSelected())
       alert('day is already selected:' + day.get_year() + '/' + day.get_month() + '/' + day.get_day());
    }
    function calendarSel(cal, args)
    {
    }
    </script>
    <ig:WebMonthCalendar ID="WebMonthCalendar1" runat="server">
      <ClientEvents MouseDown="calendarMouseDown" SelectionChanging="calendarSel" />
    </ig:WebMonthCalendar>

Reply Children