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

ShowPopup error

3 Answers 44 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jeff Nafe
Top achievements
Rank 1
Jeff Nafe asked on 25 Nov 2008, 07:22 PM
Since upgrading to 2008 Q3, I am getting an error when trying to display a DatePicker via the showPopup method. My DatePicker control is as follows:

        <telerik:RadDatePicker ID="dtPckr" runat="server" SharedCalendarID="cal" Width="19px" Height="10px">
            <DateInput ID="DtInpt" runat="server" style="display:none;"></DateInput>
            <DatePopupButton ToolTip="Calendar" style="display:none;"/>
            <ClientEvents OnDateSelected="OnDateSelected" />
        </telerik:RadDatePicker>

I have a Span on the page, that upon clicking on it fires off the following javascript:

                function togglePopup() {
                    $find("<%= dtPckr.ClientID %>").showPopup();
                }
Upon clicking this, the Telerik code bombs within the ShowPopup function on the following lines since _6 gets set to Null:

_6=this.get__popupImage();
var _7=this.getElementPosition(_6);

I'm not sure if something changed within this release or if my code needs to change?

Thanks, Jeff




3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 26 Nov 2008, 12:32 PM
Hi Jeff,

In order to work properly, RadDatePicker must not have its textbox and popup button hidden with display:none.

Here is a code library example, demonstrating how to make RadDateTimePicker work with all its elements invisible:

How to Use RadDateTimePicker Without a Textbox And Popup Buttons

If your scenario is different and you can't use the provided example, explain us what exactly are you trying to do and we will give further advice.


Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff Nafe
Top achievements
Rank 1
answered on 26 Nov 2008, 03:05 PM
Thanks! My situation was kind of different since I had RadCalendar on the page that I was referencing from the RadDatePicker via the SharedCalendarId property (so I could control it's styles, date ranges, etc). This RadCalendar control had the id of 'cal'. Once I changed this id, it started to work properly. I'm still researching as to why, but I haven't found a reason yet. Maybe the "cal" id was interfering with some variable at another point of my code?

Thanks!
0
Dimo
Telerik team
answered on 26 Nov 2008, 04:07 PM
Hi Jeff,

I can't be sure about this really. You can use some Javascript debugger to find out why the ID that you are using matters and what breaks the Javascript code.

Kind regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Jeff Nafe
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jeff Nafe
Top achievements
Rank 1
Share this question
or