This is a migrated thread and some comments may be shown as answers.

set focus on date input without showing popup

2 Answers 164 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ashraf
Top achievements
Rank 2
Ashraf asked on 27 Nov 2012, 12:25 PM
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 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 29 Nov 2012, 08:30 AM
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.
0
Ashraf
Top achievements
Rank 2
answered on 29 Nov 2012, 09:07 AM
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();
                }
            }
Tags
Calendar
Asked by
Ashraf
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Ashraf
Top achievements
Rank 2
Share this question
or