PDA

View Full Version : [CLOSED] FieldLabel on non field controls



Justin_Wignall
Jun 06, 2012, 7:41 AM
In Ext 1.3 I am using the FieldLabel property on Panels, Labels and Buttons - mostly as a simple tool to help align UserControls and so on with other standard form controls such as TextFields e.g.




<ext:Panel ID="pnlA" runat="server" Border="false" Layout="FormLayout">
<Items>
<ext:TextField ID="txtB" runat="server" FieldLabel="My Textbox" />
<ext:Label ID="lblC" runat="server" FieldLabel="My Label" />
<ext:Checkbox ID="chkIsEnabled" runat="server" BoxLabel="Check me" />
<ext:Button ID="btnUpdateName" runat="server" FieldLabel="Perform Action">
</ext:Button>
<ext:Panel ID="pnlB" runat="server" FieldLabel="Label for UC">
<Content>
User control or other nested content here
</Content>
</ext:Panel>
</Items>
</ext:Panel>



In attempting to upgrade to 2.0 I see that FieldLabel is no longer available for Label, Button, Panel and other controls that don't inherit from the Field base class.


My question is - What is the recommended design pattern to get custom "non field" content both aligned with and labelled identically to regualr field controls in a FormLayout/AnchorLayout scenario.


(Also ChangeLog says "75. FormLayout has been removed. Use AnchorLayout." but FormLayout is still in the examples)

Daniil
Jun 06, 2012, 9:34 AM
Hi,

I would use a FieldContainer.

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>
<ext:ResourceManager runat="server" />
<ext:Panel runat="server" Layout="FormLayout">
<Items>
<ext:TextField runat="server" FieldLabel="TextField" />
<ext:Label runat="server" FieldLabel="Label" />
<ext:Checkbox runat="server" BoxLabel="Check me" FieldLabel="Checkbox" />
<ext:FieldContainer runat="server" FieldLabel="Button">
<Items>
<ext:Button runat="server" Text="Click me" />
</Items>
</ext:FieldContainer>
<ext:FieldContainer runat="server" FieldLabel="User control">
<Items>
<ext:Panel runat="server">
<Content>
User control or other nested content here
</Content>
</ext:Panel>
</Items>
</ext:FieldContainer>
</Items>
</ext:Panel>
</body>
</html>



(Also ChangeLog says "75. FormLayout has been removed. Use AnchorLayout." but FormLayout is still in the examples)

Yes, ti has returned. Thanks for the report, we will remove that item.

Justin_Wignall
Jun 07, 2012, 3:22 PM
Thanks Daniil