Sep 19, 2012, 9:23 PM
[CLOSED] FieldDefaults inheritance
Below is a simple Window with FieldContainer(s). I was trying to understand how FieldDefaults are inherited. I would have assumed that the second FieldContainer would have inherited the FieldDefaults but it didn't. Is something wrong? If I uncomment the additional FieldDefaults in the 2nd container everything is displayed properly.
Based on Sencha Documentation for FieldContainer:
Based on Sencha Documentation for FieldContainer:
Like regular fields, FieldContainer can inherit its decoration configuration from the fieldDefaults of an enclosing FormPanel. In addition, FieldContainer itself can pass fieldDefaults to any fields it may itself contain.
<%@ 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 id="Head1" runat="server">
<title>Field Default Samples</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window runat="server" Width="500" BodyPadding="5">
<Items>
<ext:FormPanel runat="server" Border="false">
<FieldDefaults LabelAlign="Right" LabelWidth="90" />
<Items>
<ext:FieldSet ID="FieldSet1" runat="server" Title="General" Collapsible="true" Collapsed="false">
<Items>
<ext:FieldContainer runat="server" FieldLabel="Name" Layout="HBoxLayout">
<FieldDefaults HideLabel="true" />
<Items>
<ext:TextField runat="server" EmptyText="First" Flex="1" FieldLabel="First Name" />
<ext:TextField runat="server" EmptyText="Last" Flex="2" FieldLabel="Last Name" />
</Items>
</ext:FieldContainer>
<ext:FieldContainer runat="server" Layout="HBoxLayout">
<%-- <FieldDefaults LabelAlign="Right" LabelWidth="90" />
--%>
<Items>
<ext:TextField runat="server" EmptyText="First" Flex="1" FieldLabel="First Name" />
<ext:TextField runat="server" EmptyText="Last" Flex="2" FieldLabel="Last Name" />
</Items>
</ext:FieldContainer>
<ext:TextArea runat="server" FieldLabel="Text Area" AnchorHorizontal="100%" />
</Items>
</ext:FieldSet>
</Items>
</ext:FormPanel>
</Items>
</ext:Window>
</body>
</html>
Last edited by Daniil; Sep 20, 2012 at 5:32 PM.
Reason: [CLOSED]