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

Window close button not responding

1 Answer 74 Views
Window
This is a migrated thread and some comments may be shown as answers.
Yeroon
Top achievements
Rank 2
Yeroon asked on 02 Jul 2009, 12:12 PM

 

 

 

 

 

Hello,

I have the follwoing code on my aspx page. When ommiting the line oWnd.show(); in the javascript function the Close button on the radwindow is not working. When I take out that line, everything else is working as expected. Is this problem by design or am I missing something? Can you elaborate on the difference between using and not using the oWnd.show(); ? Using 2009 Q1 release.

<telerik:RadCodeBlock> 
 
<script> 
 
 
 
function openWin() {  
 
var activiteitSettings = document.getElementById('<%=activeActiviteitType.ClientID %>').value;  
 
var oWnd = $find("<%=RadWindow1.ClientID%>");  
 
var pos = GetTopLeftPosition(event.srcElement);  
 
dirty = 0;  
 
var d = Date.parseDate(document.getElementById('<%=infoArray.ClientID %>').value, "d-m-yy");  
 
var voor = document.getElementById('<%=voor.ClientID %>').value;  
 
 
if (activiteitSettings == 0)  
 
oWnd.setUrl("PopForms/Pop_Activiteit_Edit.aspx?urenoid=" + event.srcElement.id + "&g=" + voor + "&maandag=" + d.getDate() + '-' + eval(d.getMonth() + 1) + '-' + d.getFullYear());  
 
else if (activiteitSettings == 1)  
 
oWnd.setUrl("PopForms/Pop_Activiteit_Edit_Select.aspx?urenoid=" + event.srcElement.id + "&g=" + voor + "&maandag=" + d.getDate() + '-' + eval(d.getMonth() + 1) + '-' + d.getFullYear());  
 
oWnd.show();  
 
oWnd.moveTo(pos.x + parseInt(event.srcElement.clientWidth), pos.y);  
 
 
}  
 
</script> 
 
</telerik:RadCodeBlock> 
 
 
<telerik:RadWindow ID="RadWindow1" Skin="Vista" NavigateUrl="PopForms/Pop_Activiteit_Edit.aspx" KeepInScreenBounds="true"   
 
runat="server" Width="300px" Height="200px" ShowContentDuringLoad="false" VisibleTitlebar="true" VisibleStatusbar="false"   
 
Behaviors="Close, Move, Resize" > 
 
</telerik:RadWindow> 
 

1 Answer, 1 is accepted

Sort by
0
Accepted
Fiko
Telerik team
answered on 03 Jul 2009, 12:10 PM
Hi Yeroon,

We recommend you use the oWnd.show() function every time when you need to show the RadWindow control from client side code. This function performs some additional initializations in the RadWindow itself that are needed in order to work properly. If instead of show() some other function like moveTo() or center() is used, there will be problems like the one that you currently have.

An exception is when you use radopen() function. In this case the show() function is called internally and you do not need to call it explicitly for the newly opened RadWindow.

Best wishes,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Yeroon
Top achievements
Rank 2
Answers by
Fiko
Telerik team
Share this question
or