RadTimePicker cancel problem

2 posts, 0 answers
  1. Martin
    Martin avatar
    84 posts
    Member since:
    Apr 2009

    Posted 10 Jan 2010 Link to this post

    I have RadTimePicker and defined client event for date selection <ClientEvents OnDateSelected="DateChanged" />
    Then inside DateChanged function I have the cancel code, which does not work.

     

    function DateChanged(sender, args)

     

    {

     

     

    args.set_cancel(

    true);

     

    }

    My question is how can I make cancel work. Thanks.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jan 2010 Link to this post

    Hi Martin,

    I tried the following client side code in order to set the old selected value when trying to select new one, which will in turn function like newly selected value is canceled.

    Client-side code:
     
    <script type="text/javascript"
        var check = false
        function DateChanged(sender, args) { 
            if (args.get_oldDate() != null) { 
                var dt = new Date(); 
                if (!check) { 
                    check = true
                    sender.set_selectedDate(args.get_oldDate()); 
                } 
                check = false
            } 
        } 
    </script> 

    Hope this helps,
    Shinu.
Back to Top