exception on getWindowBounds

2 posts, 0 answers
  1. Mathieu
    Mathieu avatar
    20 posts
    Member since:
    Jun 2012

    Posted 02 Apr 2013 Link to this post

    when i do :
    $find("<%= AddActiviteWindow.ClientID %>").getWindowBounds();
    i get : 
    Uncaught TypeError: Cannot read property 'style' of null Telerik.Web.UI.WebResource.axd:7068
    a.RadWindow._getCurrentBounds Telerik.Web.UI.WebResource.axd:7068
    a.RadWindow._getCalculatedPopupBounds Telerik.Web.UI.WebResource.axd:7097
    a.RadWindow.getWindowBounds Telerik.Web.UI.WebResource.axd:6848
    this is because in _getCurrentBounds you do : var c=(this._popupElement.style.display=="none")?true:false;
    but you don't check if 
    _popupElement exist. In my case because the radwindow is not display, _popupElement is null so i would suggest to add : if (!this._popupElement) return; before this._getCurrentBounds() in the function _getCalculatedPopupBounds

    best regards Mathieu

  2. Marin Bratanov
    Marin Bratanov avatar
    3563 posts

    Posted 04 Apr 2013 Link to this post

    Hello Mathieu,

    Thank you for taking the time to investigate this. I am logging it for further research on our end and I have also updated your Telerik points for sharing this information with us.

    Generally, the getWindowBounds() method is designed to work on an already shown RadWindow, hence the lack of such a check. You can emulate it by using the isVisible() method as a flag:
    var wnd = $find("<%= RadWindow1.ClientID %>");
    if (!wnd.isVisible()) wnd.show(); //or simply return

    Marin Bratanov
    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. DevCraft R3 2016 release webinar banner
Back to Top