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

Maximized-mode window not resizes when browser resizes

4 Answers 111 Views
Window
This is a migrated thread and some comments may be shown as answers.
Channa Leang
Top achievements
Rank 1
Channa Leang asked on 24 May 2010, 05:09 PM
I'm in the middle of upgrading process from RadControls ASP.NET Q2 2007 to Asp.Net Ajax Q1 2010. One of my issues I'm facing now is, my popup radwindow in maximized mode doesn't resize when I resize the browser in Q1 2010. It's working though in my old Q2 07.

Here is the code in Q2 07,

<radW:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="False" ShowContentDuringLoad="False" runat="server" Left="" SkinsPath="~/RadControls/Window/Skins" Title="" Top="">
        <Windows>
            <radW:RadWindow ID="winEdit" SkinsPath="~/RadControls/Window/Skins/Default" Modal="True" Height="600px" Width="1000px" VisibleStatusbar="False" runat="server" Title="Loading..." />
        </Windows>
    </radW:RadWindowManager>


in Q1 2010,

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="winEdit" runat="server" InitialBehaviors="Maximize" KeepInScreenBounds="true" Behaviors="Reload,Minimize,Maximize,Resize,Close" Modal="true" VisibleStatusbar="false" ShowContentDuringLoad="false" ReloadOnShow="true" Title="Loading..." Skin="WebBlue" />
    </Windows>
</telerik:RadWindowManager>


and both have the same javascript function to pop the window,

<script type="text/javascript">
function ShowWindow( url,winId ) {
    var x = window.radopen(url, winId);
    x.Maximize(); 
    return false;
}
</script>

Help!

4 Answers, 1 is accepted

Sort by
0
Channa Leang
Top achievements
Rank 1
answered on 25 May 2010, 07:48 PM
Here is my work around on this issue,

$(document).ready(function() {
        $(window).bind('resize', function() {
            var oManager = GetRadWindowManager();
            if (typeof oManager == 'undefined') {
                return false;
            } else {
                var oWnd = oManager.getWindowByName("winEdit");
                if (oWnd != null) oWnd.maximize();
            }
        });
    });


Let me know if you have a better solution.
0
Petio Petkov
Telerik team
answered on 26 May 2010, 02:59 PM
Hello Channa,

The problem itself is related to the "em" element which is in the titlebar. Its width is calculated via JavaScript and if you try to resize the browser to smaller width - it will not resize the window to smaller width. We know about this problem and we will do our best to fix it for one of our future releases.
I created a workaround which overrides the _maintainMaximizedSize method.
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        function ShowWindow( url,winId ) {
            var x = window.radopen(url, winId);
            return false;
        }
  
        Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSizeOld = Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSize;
        Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSize = function ()
        {
  
            var titleElem = this._getTitleElement();
            if (titleElem)
            {
                titleElem.style.display = "none";
                this._updateTitleWidth();
            }
  
            this._maintainMaximizedSizeOld();
            if (titleElem)
            {
                titleElem.style.display = "";
            }
        }
  
          
    </script>
    <div>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="winEdit" runat="server" InitialBehaviors="Maximize" 
                    KeepInScreenBounds="true"
                    Behaviors="Reload,Minimize,Maximize,Resize,Close" Modal="true" VisibleStatusbar="false"
                    ShowContentDuringLoad="false" ReloadOnShow="true" Title="Loading..." Skin="WebBlue" />
            </Windows>
        </telerik:RadWindowManager>
        <input type="button" value="open window" onclick="ShowWindow('http://www.google.com','winEdit')"/>
    </div>
    </form>
</body>
</html>

Hope this helps.

Kind regards,
Petio Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Channa Leang
Top achievements
Rank 1
answered on 26 May 2010, 03:48 PM
Thanks Petio. After applying your code, it seems working in IE, but not in Firefox (run on v3.6.3) :-(
0
Petio Petkov
Telerik team
answered on 27 May 2010, 04:04 PM
Hello,

I tested the page I sent to you under FF(version 3.6.3) and it works. When I resize the browser - the maximized RadWindow is resized too.
Could you please try to delete the browser cache and check it again?  Also you can add an alert in the code to check whether it is executed or not, e.g.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<head id="Head1" runat="server"
    <title></title
</head
<body
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager
    <script type="text/javascript">
        function ShowWindow(url, winId)
        {
            var x = window.radopen(url, winId);
            return false;
        }
  
        Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSizeOld = Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSize;
        Telerik.Web.UI.RadWindow.prototype._maintainMaximizedSize = function ()
        {
            alert(1);
            var titleElem = this._getTitleElement();
            if (titleElem)
            {
                titleElem.style.display = "none";
                this._updateTitleWidth();
            }
  
            this._maintainMaximizedSizeOld();
            if (titleElem)
            {
                titleElem.style.display = "";
            }
        
    </script
    <div
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            <Windows
                <telerik:RadWindow ID="winEdit" runat="server" InitialBehaviors="Maximize" 
                    KeepInScreenBounds="true"
                    Behaviors="Reload,Minimize,Maximize,Resize,Close" Modal="true" VisibleStatusbar="false"
                    ShowContentDuringLoad="false" ReloadOnShow="true" Title="Loading..." Skin="WebBlue" /> 
            </Windows
        </telerik:RadWindowManager
        <input type="button" value="open window" onclick="ShowWindow('http://www.google.com','winEdit')"/> 
    </div
    </form
</body
</html>

Looking forward for your reply.

Greetings,
Petio Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Channa Leang
Top achievements
Rank 1
Answers by
Channa Leang
Top achievements
Rank 1
Petio Petkov
Telerik team
Share this question
or