PDA

View Full Version : [CLOSED] Problem with layout window fitlayou (perhaps a bug)



feanor91
Apr 26, 2012, 1:59 PM
Hello

In this code :



<ext:Window
ID="wndTarget"
runat="server"
Icon="Table"
Width="400"
Height="120"
Layout="FitLayout"
Hidden="True"
ExpandOnShow="True"
MinHeight="100"
MinWidth="100"
Maximizable="False"
Resizable="False"
TitleCollapse="True"
Title="Target value"
Padding="5"
Collapsible="True">
<Items>
<ext:NumberField ID="txtTarget" runat="server" FieldLabel="New target value (actual 0)" DecimalSeparator="." LabelWidth="200" Width="280"></ext:NumberField>
<ext:Hidden ID="txtidRmdEntity" runat="server" Text=""></ext:Hidden>
</Items>
<Buttons>
<ext:Button ID="btnValidateTarget" runat="server" Text="OK" >
</ext:Button>
</Buttons>
</ext:Window>
</Window>


label is not well aligned :4179

Daniil
Apr 26, 2012, 5:20 PM
Hi,

It's a bit strange layout: Window with FitLayout and a single field.

I would set up

Layout="AnchorLayout"
for the Window and

AnchorHorizontal="100%"
for the NumberField.

You can also remove

Width="280"
of the NumberField.

If you really need FitLayout, then please add

Cls="my-align"
for NumberField.

The "my-align" CSS class definition.

<style type="text/css">
.my-align .x-form-item-body {
vertical-align: top;
}
</style>

feanor91
Apr 26, 2012, 5:35 PM
Hi,

It's a bit strange layout: Window with FitLayout and a single field.



lol, yeah,I think so, I think it is a copy/paste of something. I will follow your lead. Thank you.

Beside that, the behavior is strange, in V1.3 my label was centered with the field with he same config.

Daniil
Apr 26, 2012, 5:44 PM
To center a field vertically and stretch it horizontally, I would suggest the following layout.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Window
runat="server"
Height="400"
Width="600"
Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Pack="Center" Align="Stretch" />
</LayoutConfig>
<Items>
<ext:NumberField runat="server" FieldLabel="FieldLabel" />
<ext:Hidden runat="server" />
</Items>
</ext:Window>
</form>
</body>
</html>

feanor91
Apr 27, 2012, 7:34 AM
It works. Thanks a lot.