PDA

View Full Version : [CLOSED] Layout Config



adelaney
Sep 21, 2012, 4:40 PM
I am using MVC/Razor. I am using a Radio group with a custom config:

Html.X.RadioGroup() _
.AllowBlank(False) _
.AutoFitErrors(False) _
.MsgTarget(MessageTarget.Side) _
.FieldLabel("Template") _
.Layout(LayoutType.Column) _
.Items(
Html.X.Container() _
.ID("radioCol1") _
.ColumnWidth(1) _
.Items(
Html.X.Component().Html("To Client").Cls("x-form-check-group-label"),
Html.X.Radio().ID("rdoClientFirst").BoxLabel("Client First or Simultaneously").BoxLabelStyle("font-weight:normal !important").BoxLabelAlign(BoxLabelAlign.After),
Html.X.Radio().ID("rdoFullyExecuted").BoxLabel("Fully Executed"),
Html.X.Component().Html("To RI").Cls("x-form-check-group-label"),
Html.X.Radio().ID("rdoRIFirst").BoxLabel("First or Simultaneously"),
Html.X.Radio().ID("rdoRISecond").BoxLabel("Second"),
Html.X.Radio().ID("rdoClientSignature").BoxLabel("Client Signature")
)
))

I have been trying to find the "pack" feature of the layout configuration so that I can get the radio group items to pack to the top, but I can't seem to find it. Is that still available in 2.0? If not, is there an equivalent?

Daniil
Sep 21, 2012, 7:32 PM
Hi @adelaney,

There was no "pack" feature for Column layout. It is available for HBoxLayout and VBoxLayout.

Though I am not 100% sure what you mean.

If you would provide a mockup of the required layout, we could suggest something.

KBorkiewicz
Dec 05, 2012, 8:40 PM
How do you use layoutconfig in MVC for VBox?

Daniil
Dec 06, 2012, 6:02 AM
Hi @KBorkiewicz,

Do you mean Razor? Here it is.

Example

<!DOCTYPE html>

<html>
<head>
<title>Ext.Net.MVC v2 Example</title>
</head>
<body>
@Html.X().ResourceManager()

@(Html.X().Container()
.Height(200)
.Width(200)
.LayoutConfig(
new VBoxLayoutConfig()
{
Align = VBoxAlign.Stretch
}
)
.Items(
Html.X().Container().Flex(1).StyleSpec("background-color: green;"),
Html.X().Container().Flex(1).StyleSpec("background-color: yellow;")
)
)
</body>
</html>

KBorkiewicz
Dec 06, 2012, 3:17 PM
That is what I meant, thank you. However I get these errors when I try to do that:


"The best overloaded method match for 'Ext.Net.AbstractContainer.Builder<Ext.Net.Container,Ext.Net.Container.Builder>.LayoutConfig(System.Action<Ext.Net.LayoutConfigCollection>)' has some invalid arguments"

"Argument 1: cannot convert from 'Ext.Net.VBoxLayoutConfig' to 'System.Action<Ext.Net.LayoutConfigCollection>'"

Daniil
Dec 06, 2012, 3:37 PM
What is the Ext.NET version you are trying with?

KBorkiewicz
Dec 06, 2012, 3:41 PM
Ext.NET.Pro.2.0.0

Daniil
Dec 06, 2012, 3:50 PM
Please update to v2.1.

KBorkiewicz
Dec 06, 2012, 4:09 PM
Thank you, it works!