.show() affecting modal setting?

4 posts, 0 answers
  1. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 26 Oct 2009 Link to this post

    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.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Oct 2009 Link to this post

    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.
  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Oct 2009 Link to this post


    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.
  4. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 29 Oct 2009 Link to this post

    Thanks, I found the problem. For some reason, there was a setmodal line in my getradwindow function.
Back to Top