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

exception on getWindowBounds

1 Answer 78 Views
Window
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
mathieu asked on 02 Apr 2013, 09:07 PM
hi, 
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
reSizeRadeditor
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




1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Apr 2013, 03:09 PM
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
wnd.getWindowBounds();



Regards,
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.
Tags
Window
Asked by
mathieu
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or