Mar 27, 2013, 10:02 PM
[CLOSED] Check to see if panel is collapsed
I have an application that is somewhat similar to https://examples2.ext.net/#/GridPane.../Form_Details/, but it uses a collapsible tab panel with two tabs on the right hand side rather than the form panel in the example, and uses DisplayFields rather than TextFields.
I load the tabs with details and reveal them when 1. an item is selected and 2. a choice is made from the context menu.
I want to change the data shown in these detail tabs when I select another item, but ONLY if the tabs are not collapsed.
Something like this (this is a truncated version of the code, and this particular version hasn't been compiled; but the only thing going wrong in the full version is the commented line in the DirectEvent codebehind):
Thanks!
Patrick
I load the tabs with details and reveal them when 1. an item is selected and 2. a choice is made from the context menu.
I want to change the data shown in these detail tabs when I select another item, but ONLY if the tabs are not collapsed.
Something like this (this is a truncated version of the code, and this particular version hasn't been compiled; but the only thing going wrong in the full version is the commented line in the DirectEvent codebehind):
<ext:Viewport ID="MyViewport" runat="server" Layout="Border">
<ext:GridPanel runat="server" region="Center" ID="ItemsGrid" ContextMenuID="ItemsContextMenu" ClientIDMode="Static">
<Store>
<ext:Store runat="server" ID="ItemsStore" ClientIDMode="Static" OnReadData="ReadData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model runat="server" IDProperty="ItemID">
<Fields>
<ext:ModelField Name="ItemID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server" ID="ItemsColumnModel">
<Columns>
<ext: Column runat="server" Text="ID" DataIndex="ItemID" />
</Columns>
</ColumnModel>
<DirectEvents>
<SelectionChange OnEvent="RefreshDetails">
<ExtraParams>
<ext:Parameter Name="ItemID" Value="#{ItemsGrid}.getSelectionModel().getLastSelected().data.ItemID" Mode="Raw" />
</ExtraParams>
</SelectionChange>
</DirectEvents>
</ext:GridPanel >
<ext:TabPanel runat="server" ID="DetailsPanel" Region=East" Split="true" Collapsible="true" Collapsed="true" CollapseDirection="Right" Width="300" Border="true">
<Items>
<ext:Panel ID="MainDetails" runat="server" Region="East" Split="true" Margins="0 5 5 5">
<Items>
<ext:DisplayField ID="ItemIDDisplay" runat="server" FieldLabel="Item ID" Name="ItemID" Visible="true" />
</Items>
</ext:Panel>
<ext:Panel ID="SecondaryDetails" runat="server" Region="East" Split="true" Margins="0 5 5 5">
<Items>
<ext:DisplayField ID="SecondaryItemIDDisplay" runat="server" FieldLabel="Item ID" Name="ItemID" Visible="true" />
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</ext:Viewport>
And in the behind code: protected void RefreshDetails(object sender, DirectEventArgs e)
{
bool DetailsAreShowing = (DetailsPanel.Collapsed == false || ItemIDDisplay.Text.Trim().Length > 0); // ** THIS IS MY PROBLEM AREA
if (DetailsAreShowing)
{
int newItemID = int.Parse(e.ExtraParams["ItemID"]);
ItemDetailsBind(newItemID);
}
}
So, I just need to be able to assign a value to the boolean "DetailsAreShowing" that tells me whether or not the DetailsPanel is visible. Any suggestions? Or is this something that has to be done with a DirectMethod? Thanks!
Patrick
Last edited by Baidaly; Mar 29, 2013 at 3:10 PM.
Reason: [CLOSED]