PDA

View Full Version : [CLOSED] Field and FieldContainer layout exception in form



cleve
Aug 11, 2012, 2:19 PM
Hi guys, here is the code:



<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body id="theBody">
<form id="form1" runat="server">
<ext:ResourceManager ID="theManager" runat="server"
IDMode="Static"
Theme="Default"
ShowWarningOnAjaxFailure="false"
ScriptMode="Debug" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:Panel runat="server" ID="pTest" Layout="FormLayout" BodyStyle="padding:20px;">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="AAAA">
<Listeners>
<Click Handler="testFunc();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:TextField runat="server" Width="200" FieldLabel="Field1" />
<ext:FieldContainer runat="server" AnchorHorizontal="100%" Layout="HBoxLayout">
<Items>
<ext:TextField runat="server" Width="200" FieldLabel="Field2" />
<ext:Checkbox runat="server" BoxLabel="Haha" />
</Items>
</ext:FieldContainer>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
<script runat="server">


protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}


</script>


I felt upset to see two fields, even with same width value, were placed in such a nasty way (attached).
Any ideas?

Daniil
Aug 11, 2012, 3:58 PM
Hi,

FormLayout in Ext.NET v2 just places fields one under another and stretches to the Container width.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.layout.container.Form (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.layout.container.Form)

It ignores Width and Anchor settings.

I think you should use AnchorLayout.

Though, I think, there is a real issue with FormLayout. We will investigate. Thanks for the report.

Daniil
Aug 13, 2012, 7:17 AM
Though, I think, there is a real issue with FormLayout. We will investigate. Thanks for the report.

I have discovered a bug in our scripts. We are investigating a possible fix.

Daniil
Aug 13, 2012, 2:04 PM
The fix has been added to SVN. Thanks again for the report.