PDA

View Full Version : [CLOSED] Two panels MVC Razor



ingbabic
May 14, 2015, 4:49 PM
Hi
Could you please explain me how to create two panels inside another panel, which are set horizontally (for example one having width 80% and another 20%) and are filling total space of parent panel (like on picture). I suppose, I could do it using javascript but I wonder if there is simpler option.

23978

Daniil
May 14, 2015, 8:53 PM
Hi @ingbabic,

I think HBoxLayout is a way to go.
http://mvc2.ext.net/#/Layout_HBoxLayout/Basic

ingbabic
May 15, 2015, 7:29 AM
Ok, but they are not stretching to the height of parent panel




<style type="text/css">
.redColor {
background: #FF0000;
}
</style>

@(
Html.X().Panel().Layout(LayoutType.HBox).Height(30 0).Items
(
Html.X().Panel().Title("One").Flex(8).BodyCls("redColor")
,
Html.X().Panel().Title("Another").Flex(2)
)
)

In previous sample you would not see red color until you manually set the height of inner panel.

Daniil
May 15, 2015, 7:37 AM
In the example that I mentioned there is the "Align: Stretch" button which is, probably, what you need.

ingbabic
May 15, 2015, 7:54 AM
Exactly :)