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

Restriction Zone problem in Q3 SP1

5 Answers 13 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 16 Nov 2015, 10:31 AM

Hi,

After upgrading to Q3 SP1 (from Q3), windows can't be moved all the way to the right and bottom of a restriction zone when using ligthweight render mode!

This did work in the Q3 release.

It also works if setting to Classic mode...

It seems like the padding and border of the window isn't taken care of in this case...

Sample:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
 
<!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="s" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:Panel ID="pnlRestrictionZone" runat="server" Style="width: 700px; height: 500px; background-color: blue">
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <Windows>
                        <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true" RenderMode="Lightweight" Title="Hello" NavigateUrl="http://www.telerik.com" VisibleStatusbar="false" RestrictionZoneID="pnlRestrictionZone">
                        </telerik:RadWindow>
                    </Windows>
                </telerik:RadWindowManager>
            </asp:Panel>
        </div>
    </form>
</body>
</html>

 

In the sample above, try move the window all the way to the right of the restriction zone, you will notice that there will be an extra space left (same as total padding and border of the window)!

Regards
Andreas

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 16 Nov 2015, 01:26 PM

Hello Andreas,

Could you try setting the RenderMode to the window manager and not to the RadWindow only? The current code loads both the classic and Lightweight stylesheets at the same time which causes the issue, and this must be avoided as explained here: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/mobile-support/render-modes.

I just tried the following and I had no issues:

<asp:Panel ID="pnlRestrictionZone" runat="server" Style="width: 700px; height: 500px; background-color: blue">
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" RenderMode="Lightweight">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true"  Title="Hello" NavigateUrl="http://www.telerik.com" VisibleStatusbar="false" RestrictionZoneID="pnlRestrictionZone">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
</asp:Panel>

Regards,

Marin Bratanov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 16 Nov 2015, 01:40 PM

Hi,

I tried your code, but I get the issue remains...

Regards
Andreas
0
Marin Bratanov
Telerik team
answered on 16 Nov 2015, 01:45 PM

Hi,

Does this happen on this blank simple page or does the issue still occur in your larger project? If it is the former, could you open a ticket where you can send us a sample we can investigate? If it is the latter, can you confirm there are no other RadWindowManager/RadWindow instances with varying RenderMode values?

Regards,

Marin Bratanov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 16 Nov 2015, 02:14 PM

Hi,

It still happens in both cases. There are no instances with varying RenderMode.

Doing the following prototype (changed to Q3 measuring code), helps in both cases:

Telerik.Web.UI.Widgets.Draggable.prototype._calcConstraints = function (delta, position, constraints)
        {
            var $ = $telerik.$;
 
            var result = delta;
            //CHANGED THIS **********************************************************************************************************
            //Otherwise window can't be moved all the way to the right or bottom of screen
            //var elementWidth = this._element.offsetWidth;
            //var elementHeight = this._element.offsetHeight;
            var elementWidth = $(this._element).width();
            var elementHeight = $(this._element).height();
            //**********************************************************************************************************************
             
            if ((constraints.maxX != null && position.x + elementWidth > constraints.maxX) ||
                (constraints.minX != null && position.x < constraints.minX) ||
                (constraints.maxY != null && position.y + elementHeight > constraints.maxY) ||
                (constraints.minY != null && position.y < constraints.minY)
                )
                return { x: 0, y: 0 };
 
            if (delta.x < 0)
                result.x = constraints.minX !== null && !isNaN(constraints.minX) ?
                    Math.max(delta.x, constraints.minX - position.x) :
                    delta.x;
            else
                result.x = constraints.maxX !== null && !isNaN(constraints.maxX) ?
                    Math.min(delta.x, constraints.maxX - position.x - elementWidth) :
                    delta.x;
 
            if (delta.y < 0)
                result.y = constraints.minY !== null && !isNaN(constraints.minY) ?
                    Math.max(delta.y, constraints.minY - position.y) :
                    delta.y;
            else
                result.y = constraints.maxY !== null && !isNaN(constraints.maxY) ?
                    Math.min(delta.y, constraints.maxY - position.y - elementHeight) :
                    delta.y;
 
            return result;
        };

Regards
Andreas
0
Accepted
Marin Bratanov
Telerik team
answered on 17 Nov 2015, 09:11 AM

Hello Andreas,

Thank you for taking the time to research this. I am logging this issue for fixing and you can track it here: http://feedback.telerik.com/Project/108/Feedback/Details/175343-radwindow-cannot-be-dragged-all-the-way-to-the-bottom-right-in-a-restriction-zone. I have also updated your Telerik points for your report.

Regards,

Marin Bratanov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Window
Asked by
Andreas
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or