PDA

View Full Version : [CLOSED] MVC - Layout



thchuong
Sep 17, 2013, 3:13 PM
Hi,

With code below

<body> @(x.ResourceManager())


@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))
{
@(x.Viewport()
.Layout(LayoutType.Center)
.Items(x.Panel()
.Layout(LayoutType.Center)
.CustomConfig(collection => collection.Add(new ConfigItem { Name = "width", Value = "75%", Mode = ParameterMode.Value })))
.Items(x.FormPanel()
.ButtonAlign(Alignment.Center)
.Frame(true)
.Items(Html.X().TextField()
.FieldLabel("Username")
, Html.X().TextField().FieldLabel("Password"))
.Buttons(Html.X().Button().ID("login").Text("Login").Icon(Icon.Accept))))
}
</body>

I got a JavaScript error
Uncaught TypeError: Cannot call method 'substring' of undefined
6908

Can you tell me how to fix it?

Thanks,

geoffrey.mcgill
Sep 17, 2013, 4:50 PM
Hello,

I believe .width must be a fixed pixel value, not a percentage.

If you wish to use a proportional with, try using the HBoxLayout and setting the .Flex values.

I also believe the "Center" layout type has been discontinued, or at the minimum, you should not use. Much better to use HBoxLayout.

Hope this helps.

thchuong
Sep 17, 2013, 11:29 PM
Hello,

I believe .width must be a fixed pixel value, not a percentage.

If you wish to use a proportional with, try using the HBoxLayout and setting the .Flex values.

I also believe the "Center" layout type has been discontinued, or at the minimum, you should not use. Much better to use HBoxLayout.

Hope this helps.

Hi,

It does help. thank you.