PDA

View Full Version : [CLOSED] Mask position when loading Panel's content



RCN
Oct 11, 2012, 7:55 PM

Daniil
Oct 12, 2012, 6:00 AM
Hi Raphael,

I understand your problem, but where should a mask appear if no height?

I tried to put the Panel inside a Viewport with FitLayout. A mask appears to be positioned properly - in the center.

Maybe, in your case with more complex layout, you need to defer loading for some milliseconds. Unfortunately, I can't say more without a sample to reproduce.

RCN
Oct 16, 2012, 11:53 AM
If the _pnl MinHeight is not set, the ViewPort is rendered properly.

1 - View


<ext:Panel ID="_pnl" PreventHeader="true" MinHeight="100" Border="false" runat="server">
<Loader ID="Loader1" Url="/Example/FuncAbc/" Mode="Component" AutoLoad="true" runat="server">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>


2 - Action



public ContentResult FuncAbc()
{
Thread.Sleep(TimeSpan.FromSeconds(10));
ContentResult r = new ContentResult();


Viewport vwp = new Viewport
{
ID = "_vwp",
Border = false,
Layout = "BorderLayout",
};


Panel pnlCenter = new Panel
{
Title = "Center Region",
Icon = Icon.Application,
Html = "Content",
Border = false,
Collapsible = false,
Split = true,
Region = Region.Center
};
vwp.Items.Add(pnlCenter);

Panel pnlSouth = new Panel
{
Title = "South Region",
Icon = Icon.Application,
Html = "Content",
Border = false,
Collapsible = true,
Split = true,
Region = Region.South,
TitleCollapse = true,
Floatable = false,
Height = 300,
};

vwp.Items.Add(pnlSouth);

Panel pnlEastRoot = new Panel
{
Collapsible = true,
Border = false,
Floatable = false,
Split = true,
Frame = true,
TitleCollapse = true,
Layout = "accordion",
BodyStyle = "margin-top:-5px;",
Region = Region.East,
Width = 300,
MinWidth = 100,
Weight = 10
};
vwp.Items.Add(pnlEastRoot);

Panel pnlEast1 = new Panel
{
Title = "East 1",
Icon = Icon.Application,
Html = "Content",
Border = false,
Collapsible = true,
Flex = 1,
TitleCollapse = true

};
pnlEastRoot.Items.Add(pnlEast1);

Panel pnlEast2 = new Panel
{
Title = "East 2",
Icon = Icon.Application,
Html = "Content",
Collapsible = true,
Border = false,
Flex = 1,
TitleCollapse = true
};
pnlEastRoot.Items.Add(pnlEast2);

r.Content = ComponentLoader.ToConfig(vwp);

return r;
}

Daniil
Oct 16, 2012, 1:25 PM
A Viewport must be a top level container on the page within <body> or <form runat="server">. It is wrong to load it into a Panel and can cause unpredictable consequences even if it works at the first glance.

RCN
Oct 16, 2012, 1:58 PM
I understand your point, but unfortunately - in my scenario - the creation of the ViewPort occurs at server-side. is there another approach to load the ViewPort, like a "Loader", and thus it does not require a Panel to perform the load?

Daniil
Oct 16, 2012, 5:11 PM
Please clarify where do you need to render a Viewport to?

Maybe you need to load an iframe with a Viewport to this Panel?

RCN
Oct 16, 2012, 7:29 PM

RCN
Oct 16, 2012, 8:58 PM
Daniil, if you agree with this approach, please mark this thread as closed.

Daniil
Oct 17, 2012, 5:00 AM
I totally agreed with this approach. Setting up a Viewport with BorderLayout on the page and loading its regions via Loader is a common and good practice.

RCN
Oct 17, 2012, 1:58 PM
There is an update regarding the best way to accomplish this task: http://forums.ext.net/showthread.php?21570-Rendering-a-ViewPort-with-south-region-collapsed&p=93218&viewfull=1#post93218

Daniil
Oct 17, 2012, 2:02 PM
Thank you for the update!