PDA

View Full Version : [CLOSED] Composite view and fit panel - MVC



aguidali
May 27, 2014, 10:41 AM
Hi,

I'm experiencing a problem with a composite view;

This is the content of the -Layout.cshtml


<div>
@(X.Viewport()
.ID("ViewPort")
.Layout(LayoutType.Border)
.Items(items1 =>
{
items1.Add(X.Panel()
.ID("TopPanel")
.Header(false)
.Region(Region.North)
.Height(90)
.Closable(false)
.Padding(0)
.Border(true));

items1.Add(
X.Panel()
.ID("WestPanel")
.Header(false)
.Region(Region.West)
.Closable(false)
.Padding(0)
.Border(true)
.Layout(LayoutType.Fit)
.ItemsFromAction("LoadCommands", "Command"));

items1.Add(X.Container()
.ID("CenterPanel")
.Region(Region.Center)
.Padding(0)
.Border(true)
.Layout(LayoutType.Fit));

items1.Add(X.Panel()
.ID("BottomPanel")
.Header(false)
.Region(Region.South)
.Height(40)
.Closable(false)
.Padding(0)
.Border(true)
.StyleSpec("text-align: center;")
.Content(c => footerString));
}
))
</div>

In the WestPanel I have a TreePanel, each node call an action as explained in the thread
http://forums.ext.net/showthread.php?35491-CLOSED-Partial-Content-and-Tree-Node-MVC

DoubleClick on a node call the controller as explained in the code below:


public Ext.Net.MVC.PartialViewResult UserManagement()
{
return new Ext.Net.MVC.PartialViewResult("CenterPanel");
}

And the code for the view is:


@(X.Panel()
.BodyPadding(15)
.Layout(LayoutType.Fit)
.Title("Inner panel")
.Html("This panel is fit 100% Height and 100% Width within its container."))

I have two problems:

The panel don't fit the height
Resizing the window the panel doesn't resize (width and height remain the same)



Could you help me please.

Best regard

Andrea

Vladimir
May 27, 2014, 11:56 AM
Please see the following example
http://mvc.ext.net/#/Dynamic_Partial_Rendering/Partial_Items/

You have to set AddTo mode for PartialViewResult (which renders a view to center region)

aguidali
May 28, 2014, 7:28 AM
Please see the following example
http://mvc.ext.net/#/Dynamic_Partial_Rendering/Partial_Items/

You have to set AddTo mode for PartialViewResult (which renders a view to center region)

Thank you Vladimir, it works as expected.

You can close the thread.

Best regards

Andrea