Fit Layout not being applied to GridPanel on collapsed Panel/Tab

  1. #1

    Fit Layout not being applied to GridPanel on collapsed Panel/Tab

    Hi,

    I have a page with a ViewPort and 4 regions on it. The east region is collapsed by default and has a TabPanel on it with a GridPanel on each tab. Here?s the definition:

    <ext:Panel ID="PanelStats" runat="server" Collapsible="true" Collapsed="true" Region="East"
                                Split="true" Title="Stats" Width="500" Layout="FitLayout" >
                                <Listeners>
                                    <Expand Handler="statsPanelShow();" />
                                </Listeners>
                                <Items>
                                    <ext:TabPanel ID="TabPanelInfo" runat="server" TabPosition="Top" Title="InformationTabs" ActiveTabIndex="0" >
                                        <Items>
                                            <ext:Panel ID="PanelStaffStats" runat="server" Title="Staff Stats" Layout="FitLayout" >
                                                <Items>
                                                    <ext:GridPanel ID="GridPanelStaffStats" runat="server" Cls="staffStatsGrid" TrackMouseOver="true" AutoExpandColumn="Staff_Name" >
                                                        <Store>
                                                            <ext:Store ID="StoreStaffStats" runat="server">
                                                                <Reader>
                                                                    <ext:JsonReader IDProperty="SID" >
                                                                        <Fields>
                                                                            <ext:RecordField Name="SID" Type="Int" />
                                                                            <ext:RecordField Name="Staff_Name" Type="String" />
                                                                            <ext:RecordField Name="Staff_Name_Anon" Type="String" />
                                                                            <ext:RecordField Name="VacUsed" Type="Int" />
                                                                            <ext:RecordField Name="EDOUsed" Type="Int" />
                                                                            <ext:RecordField Name="SickUsed" Type="Int" />
                                                                            <ext:RecordField Name="VacRemaining" Type="Int" />
                                                                            <ext:RecordField Name="EDORemaining" Type="Int" />
                                                                        </Fields>
                                                                    </ext:JsonReader>
                                                                </Reader>
                                                            </ext:Store>
                                                        </Store>
                                                        <ColumnModel ID="ColumnModelStaffStats" runat="server" >
                                                            <Columns>
                                                                <ext:Column DataIndex="Staff_Name" Header="Staff Name" MenuDisabled="true">
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="Staff_Name_Anon" Header="Staff Name" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="VacUsed" Header="Vac Used" Width="65" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="EDOUsed" Header="EDO Used" Width="65" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="SickUsed" Header="Sick Used" Width="65" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="VacRemaining" Header="Vac Balance" Width="65" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                                <ext:Column DataIndex="EDORemaining" Header="EDO Balance" Width="65" MenuDisabled="true" >
                                                                    <Renderer Fn="StaffStatsNameRender"/>
                                                                </ext:Column>
                                                            </Columns>
                                                        </ColumnModel>
                                                        <View>
                                                            <ext:BufferView ID="BufferViewStaffStats" runat="server" RowHeight="15" />
                                                        </View>
                                                        
                                                    </ext:GridPanel>
                                                </Items>
                                            </ext:Panel>
                                         ?
                                    </ext:TabPanel>
                                </Items>
                            </ext:Panel>
    The problem is that when I first expand the panel, PanelStaffStats does not have it?s FitLayout applied to it:
    Click image for larger version. 

Name:	Screenshot1.png 
Views:	164 
Size:	9.9 KB 
ID:	4141

    However, if I resize the panel using the slider, it will then be applied afterwards:
    Click image for larger version. 

Name:	Screenshot2.png 
Views:	166 
Size:	17.6 KB 
ID:	4140

    My hacky workaround for now has been to add a listener to the expand event for the Panel, and then call GridPanelStaffStats.getView().refresh(); in the handler which also seems to apply the layout. Unfortunately when the panel is previewed (clicking the side bar, and not the expand button) that does not trigger the expand event (not sure which event is called for that) and so if the user does that they won?t be able to see the grid correctly.

    The data for this GridPanel is provided by a stored procedure and as such is loaded in the code behind on page load:

    //get the store
    Store storeStaffStats = this.StoreStaffStats;
    
    //store parameters
    Hashtable parameters = new Hashtable();
    
    //pass in the current date for the schedule
    parameters.Add("@active", true); //only get active staff
    parameters.Add("@IsRT", true);
    
    DataTable procResults = GetDataTableFromSP("Proc_VacEDOStats", parameters);
    
    storeStaffStats.DataSource = procResults;
    storeStaffStats.DataBind();
    Adding gridStaffStats.GetView().Refresh(); to the code behind did not seem to have any effect either.

    Is this a bug? Or am I missing something?

    Thanks,

    -Travis
  2. #2
    Hi Travis,

    I think setting LayoutOnTabChange="true" on the TabPanel should help solve this problem.

    Example

    <ext:TabPanel LayoutOnTabChange="true" ... />
    Geoffrey McGill
    Founder
  3. #3
    Hi Geoff,

    Just tried adding that to the TablPanel, unfortunately the layout is still not being applied correctly to the collapsed GridPanel.

Similar Threads

  1. Replies: 12
    Last Post: Jul 26, 2011, 8:26 AM
  2. Collapsed border layout Region
    By rajputamit in forum 1.x Help
    Replies: 1
    Last Post: Oct 30, 2010, 4:02 PM
  3. Border Layout not getting collapsed
    By vivekrane1986 in forum 1.x Help
    Replies: 0
    Last Post: Jun 05, 2010, 6:23 AM
  4. [CLOSED] GridPanel columns rendering in Collapsed panel
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 02, 2009, 11:50 AM
  5. Replies: 0
    Last Post: May 27, 2009, 6:50 AM

Tags for this Thread

Posting Permissions