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

RadMonthYearPicker Popup by input

4 Answers 88 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 25 Jun 2014, 08:48 PM
Is there a way that i can trigger the popup by user click on input field (textbox)?  Thank you.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Jun 2014, 06:12 AM
Hi Jospeh,

Please try to attach the onfocus event to RadMonthYearPicker and show the pop up as follows.

ASPX:
<telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" onfocus="openPopUp()">
</telerik:RadMonthYearPicker>

JavaScript:
function openPopUp() {
    var monthYearPicker = $find("<%=RadMonthYearPicker1.ClientID%>");
    monthYearPicker.showPopup();
}

Thanks,
Princy.
0
Joseph
Top achievements
Rank 1
answered on 26 Jun 2014, 03:35 PM
Hi Princy,

That didn't work, getting the error: 

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'showPopup'
0
Princy
Top achievements
Rank 2
answered on 27 Jun 2014, 03:03 AM
Hi Joseph,

Please try the below approaches to achieve your scenario.  

  • One approach is that please try to set the ShowPopupOnFocus property as true in ASPX as follows.

ASPX:

<telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" ShowPopupOnFocus="true">
</telerik:RadMonthYearPicker>

  • Another approach is that onfocus event call the click event of popup button as follows.

ASPX:

<telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" onfocus="openPopUp()">
</telerik:RadMonthYearPicker>

JavaScript:
function openPopUp() {
    var monthYearPicker = $find("<%=RadMonthYearPicker1.ClientID%>");
    monthYearPicker._popupButton.click();
}

Hope this will help you.
Thanks,
Princy.
0
Joseph
Top achievements
Rank 1
answered on 27 Jun 2014, 03:24 PM
Thank You.  That worked.
Tags
Calendar
Asked by
Joseph
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Joseph
Top achievements
Rank 1
Share this question
or