Jun 30, 2015, 5:38 PM
[CLOSED] Issue with ColumLayout and labelAlign Razor Ext 3.1
I am building a formpanel from my controller. no matter what I try the labels are left aligned.
// Panel that is returned to be added to the pop up window
pnlContainer = new Panel();
pnlContainer.Layout = "FitLayout";
pnlContainer.Border = false;
pnlContainer.Frame = true;
Panel pnlOuter = new Panel();
pnlOuter.Layout = "FitLayout";
pnlOuter.Border = false;
FormPanel formPanel = new FormPanel
{
ID = "formPanel",
Frame = true,
PollForChanges = false,
DefaultAnchor = "92%",
Border = false,
AutoScroll = true,
ButtonAlign = Alignment.Right,
BodyPadding = 2,
AnchorHorizontal = "-20",
TrackResetOnLoad = true,
FieldDefaults = { LabelAlign = LabelAlign.Top, MsgTarget = MessageTarget.Under }
};
pnlOuter.Items.Add(formPanel);
// Scenario 1 - WORKS - uncomment the next 3 lines to test this scenario
//formPanel.Items.Add(new TextField { ID = "test", LabelAlign = LabelAlign.Top, FieldLabel = "test", AllowBlank = false, MsgTarget = MessageTarget.Under });
//formPanel.Items.Add(new TextField { ID = "test2", LabelAlign = LabelAlign.Top, FieldLabel = "test2", AllowBlank = false, MsgTarget = MessageTarget.Under });
//formPanel.Items.Add(new TextField { ID = "test22", LabelAlign = LabelAlign.Top, FieldLabel = "test23", AllowBlank = false, MsgTarget = MessageTarget.Under });
// Scenario which I need is NOT working - I am building a column layout as I need 3 columns. only including one
// I have tried Panel and Container with sames results.
Ext.Net.FieldContainer col11 = new Ext.Net.FieldContainer
{
ID = "pnlCol11",
Border = false,
ColumnWidth = .5,
Layout = "FormLayout",
Defaults = { new Parameter { Name = "labelAlign", Value = "under" } },
LabelAlign = LabelAlign.Top,
MsgTarget = MessageTarget.Under
};
col11.Items.Add(new TextField { ID = "test", LabelAlign = LabelAlign.Top, FieldLabel = "test", AllowBlank = false, MsgTarget = MessageTarget.Under });
col11.Items.Add(new TextField { ID = "test2", LabelAlign = LabelAlign.Top, FieldLabel = "test2", AllowBlank = false, MsgTarget = MessageTarget.Under });
col11.Items.Add(new TextField { ID = "test22", LabelAlign = LabelAlign.Top, FieldLabel = "test23", AllowBlank = false, MsgTarget = MessageTarget.Under });
formPanel.Items.Add(col11);
pnlContainer.Items.Add(pnlOuter);
// pnlContainer is returned to controller to use with ComponentConfig.
why is LabelAlign and MsgTarget ignored in the second scenario. Thank you for your help.
Last edited by Daniil; Jul 02, 2015 at 2:10 PM.
Reason: [CLOSED]