PDA

View Full Version : How to Set The CompositeField Visible in DirectEvents



rankey
Apr 19, 2011, 3:02 AM
CompositeField Controls:

<ext:CompositeField ID="rowAmtAmount" runat="server">
...
</ext:CompositeField>
<ext:CompositeField ID="rowAuxiliary" runat="server" >
...
</ext:CompositeField>

DirectEvents:
<ext:DropDownField ID="dplSubjectCode" runat="server" DataIndex="SubjectCode" Width="200" AllowBlank="false">
<Component>
<ext:TreePanel ID="treePanel" runat="server" Width="300" Height="300" AutoScroll="true" Collapsible="true" Header="false" AllowBlank="false">
<DirectEvents>
<Click OnEvent="OnSubjectDirectSelect">
<ExtraParams>
<ext:Parameter Name="checkedNode" Value="node.id" Mode="Raw" Encode="true" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:TreePanel>
</Component>
</ext:DropDownField>protected void OnSubjectDirectSelect(object sender, EventArgs e)
{
int id = int.Parse(((Ext.Net.DirectEventArgs)(e)).ExtraPara ms[0].Value.Replace("\"", ""));
using (Data.DataEntities db = new Data.DataEntities())
{
Data.Subject model = db.Subject.Where(s => s.SubjectID == id).FirstOrDefault();
rowAuxiliary.Visible = model.AuxiliaryType != 0;
rowAmtAmount.Visible = model.IsAmtAmount;
}
}

Vladimir
Apr 19, 2011, 9:45 AM
Hi,

Please use Hidden instead Visible, also can be required to call "DoLayout" method for CompositeField container