ShowPopup error

4 posts, 0 answers
  1. Jeff Nafe
    Jeff Nafe avatar
    46 posts
    Member since:
    Sep 2007

    Posted 25 Nov 2008 Link to this post

    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




  2. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 26 Nov 2008 Link to this post

    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.
  3. Jeff Nafe
    Jeff Nafe avatar
    46 posts
    Member since:
    Sep 2007

    Posted 26 Nov 2008 Link to this post

    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!
  4. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 26 Nov 2008 Link to this post

    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.
Back to Top