set focus on date input without showing popup

3 posts, 0 answers
  1. Ashraf
    Ashraf avatar
    40 posts
    Member since:
    Aug 2012

    Posted 27 Nov 2012 Link to this post

    hi kindly help me .,in range  date filter in radgrid  .i made a function to make filter when the user hit enter key and its working fine .
    my problem is (i made when the popup closing set focus on date input to make user hit enter to filter date )
    date picker (showpoupnfoucs=true)  to show popup when the user focus on the date input .
    it's working fine but in IE the popup not hide after selecting date ;
    here is the focus function 
        function onDatePickerOnPopupClosing(sender, eventArgs) {
                    //get the date input text box
                      sender.get_dateInput().focus();
                 }
    why it's not working with IE otherwise works with other browser !!!!!!!
    i should make both (set focus when the user select date and showpoupnfoucs=true)
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 29 Nov 2012 Link to this post

    Hello Ashraf,

    Try this approach:
    function onDatePickerOnPopupClosing(sender, eventArgs) {
        window.setTimeout( new function(){sender.get_dateInput().focus();}, 50);
    }


    All the best,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashraf
    Ashraf avatar
    40 posts
    Member since:
    Aug 2012

    Posted 29 Nov 2012 Link to this post

    thanks vasil ,
    your code helped me i fixed the issue with the following code :
     //fire when the date piker popup closing to set focus on the date input
                function onDatePickerOnPopupClosing(sender, eventArgs) {
                    //get the date input text box
                    if ($telerik.isIE) {//to fix IE UI bug (popup not close)
                        sender.set_showPopupOnFocus(false);
                        sender.get_dateInput().focus();
                        setTimeout(function () { sender.set_showPopupOnFocus(true); }, 1000);
                    }
                    else {
                        sender.get_dateInput().focus();
                    }
                }
Back to Top