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

.show() affecting modal setting?

3 Answers 34 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nik
Top achievements
Rank 1
Nik asked on 26 Oct 2009, 06:59 PM
I have a function that will change the page of the current radwindow, or open a new one to the provided url. I have 2 questions regarding this function.

function ChangePage(FileName)  
{  
if (window.frameElement) {  
        // A window is already open - Redirect        
        GetRadWindow().SetUrl(FileName);  
          
        // Resize the window  
        var curWindowSize = GetRadWindow().getWindowBounds();  
        GetRadWindow().center();  
        GetRadWindow().setSize(width,height);  
        GetRadWindow().set_modal(modal);  
        //GetRadWindow().show();  
    } else {  
        // No window - open a new one  
        openRadWindow(FileName,height,width,modal,0,1,1,qty);  
    }  
}  

#1 - I recently noticed that my modal settings were getting changed after updating the url of the window. I would start with a non-modal window, click the button that triggers the change and have the window immediately go modal upon redirecting the url. I narrowed it down the the GetRadWindow().show() line being the culprit. What does show() do? The script still seems to work without it...is it necessary?

#2 - Can I change the window behaviors at the same time I'm setting the new url? Some of the destinations require the reload window and no close button when coming from the initial window that only has close.
Using version 2008.1.515.20.

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Oct 2009, 11:48 AM
Hi Nik,

Regarding your first question, I am not sure what the problem might be and I cannot reproduce it locally. Please open a support ticket and send me a small sample project that shows the problem and I will check it.

As for your second question, I believe this forum article will be of help:
http://www.telerik.com/community/forums/aspnet-ajax/window/set-behaviors-client-side.aspx


Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Georgi Tunev
Telerik team
answered on 29 Oct 2009, 11:51 AM

Just a quick followup - I just noticed that you are using GetRadWindow().set_modal(modal) - if modal variable is true, this will make the window modal. If you remove that line, the window will not change to modal.
What happens is that you always make your window modal when executing this function. When you use show(), RadWindow is being redrawn and that is why you get the modal behavior when redirecting the page.


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Nik
Top achievements
Rank 1
answered on 29 Oct 2009, 12:19 PM
Thanks, I found the problem. For some reason, there was a setmodal line in my getradwindow function.
Tags
Window
Asked by
Nik
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Nik
Top achievements
Rank 1
Share this question
or