[CLOSED] [1.0] GridPanel resize within Window

  1. #1

    [CLOSED] [1.0] GridPanel resize within Window

    In the example below, the GridPanel in the 2nd tab doesn't resize correctly when the Window is made smaller. I've tried this in both IE6/7.

    Thanks

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">    
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                strActionProgresses.DataSource = new object[]
                {
                    new object[] { 1, 22, DateTime.Now, "Some more text", "Test USER", DateTime.Now },
                    new object[] { 2, 56, DateTime.Now, "Some random text", "Test USER", DateTime.Now }
                };
                strActionProgresses.DataBind();
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        
        <ext:Store ID="strActionProgresses" runat="server">
            <SortInfo Field="CreatedDate" Direction="DESC" />
            <Reader>
                <ext:ArrayReader>
                    <Fields>
                        <ext:RecordField Name="ActionProgressID" Type="Int"></ext:RecordField>
                        <ext:RecordField Name="PercentComplete" Type="Int"></ext:RecordField>
                        <ext:RecordField Name="EstimatedCompletionDate" Type="Date"></ext:RecordField>
                        <ext:RecordField Name="Comments" Type="String"></ext:RecordField>
                        <ext:RecordField Name="CreatedByName" Type="String"></ext:RecordField>
                        <ext:RecordField Name="CreatedDate" Type="Date"></ext:RecordField>
                    </Fields>
                </ext:ArrayReader>
            </Reader>
        </ext:Store>
        
        <ext:Window runat="server" ID="wndAction" MinHeight="420" MinWidth="620" InitCenter="true" BodyStyle="padding: 5px;" Modal="true" Width="850" Height="550" Title="Action Details">
            <TopBar>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:Button ID="btnSave" runat="server" Icon="Disk" Text="Save Action">
                        </ext:Button>
                        
                        <ext:Button ID="btnDelete" runat="server" Icon="Delete" Text="Delete Action" ToolTip="Delete this record">
                        </ext:Button>
                        
                        <ext:ToolbarSeparator></ext:ToolbarSeparator>
                        
                        <ext:Button ID="btnAddStatusUpdate" runat="server" Icon="ClockAdd" Text="Update Status">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <Content>
                <ext:FitLayout ID="FitLayout1" runat="server">
                    <Items>
                        <ext:TabPanel runat="server" ID="tabAction">
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" Title="Action Details" Icon="Clock" BodyStyle="padding: 5px;">
                                    <Content>
                                        <ext:FitLayout ID="FitLayout2" runat="server">
                                            <Items>
                                                <ext:FormPanel LabelWidth="160" ID="frmAction" Frame="true" runat="server">
                                                    <Defaults>
                                                        <ext:Parameter Name="Anchor" Value="100%"></ext:Parameter>
                                                        <ext:Parameter Name="AllowBlank" Value="false" Mode="Raw"></ext:Parameter>
                                                    </Defaults>
                                                    <Items>
                                                        <ext:TextField DataIndex="ActionName" BlankText="'Action Title' is required" MaxLength="255" runat="server" ID="txtActionName" FieldLabel="Action Title"></ext:TextField>
                                                        <ext:TextArea runat="server" AllowBlank="true" ID="txtDescription" Height="100" FieldLabel="Description"></ext:TextArea>
                                                        
                                                        <ext:DateField Anchor="" DataIndex="RequiredCompletionDate" BlankText="'Required Completion Date' is required" ID="datRequiredCompletionDate" runat="server" FieldLabel="Required Completion Date"></ext:DateField>
                                                        
                                                        <ext:Checkbox ID="chkCompleted" runat="server" FieldLabel="Completed"></ext:Checkbox>
                                                    </Items>        
                                                </ext:FormPanel>
                                            </Items>
                                        </ext:FitLayout>
                                    </Content>
                                    <BottomBar>
                                        <ext:StatusBar ID="FormStatusBar" runat="server" DefaultText="Ready">
                                            <Plugins>
                                                <ext:ValidationStatus ID="ValidationStatus1" 
                                                    runat="server" 
                                                    FormPanelID="frmAction" 
                                                    ValidIcon="Accept" 
                                                    ErrorIcon="Exclamation" 
                                                    />
                                            </Plugins>
                                        </ext:StatusBar>
                                    </BottomBar>
                                </ext:Panel>
                                <ext:GridPanel Layout="Fit" Title="Status Updates" Icon="ClockGo" TrackMouseOver="false" BaseCls="textWrapGrid" AutoExpandColumn="colComments" runat="server" ID="grdActionUpdates" StoreID="strActionProgresses">
                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column Width="165" DataIndex="CreatedDate" Header="Date Updated"></ext:Column>
                                            <ext:Column ColumnID="colComments" DataIndex="Comments" Header="Comments"></ext:Column>
                                            <ext:Column Width="150" DataIndex="EstimatedCompletionDate" Header="Estimated Completion Date"></ext:Column>
                                            <ext:NumberColumn Align="Right" Format="0%" Width="120" DataIndex="PercentComplete" Header="% Complete"></ext:NumberColumn>
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                    </SelectionModel>
                                </ext:GridPanel>
                            </Items>
                        </ext:TabPanel>
                    </Items>
                </ext:FitLayout>
            </Content>
            <Tools>
                <ext:Tool Type="Close" />
            </Tools>
        </ext:Window>
    </body>
    </html>
  2. #2

    RE: [CLOSED] [1.0] GridPanel resize within Window

    Hi,

    1. Remove Layout="Fit" for GridPanel, it is not required
    2. Don't use BaseCls if don't change ui logic of control. Use Cls. So, use Cls instead BaseCls
  3. #3

    RE: [CLOSED] [1.0] GridPanel resize within Window

    Hi Dan,

    I noticed an optimization as well...

    1. Set Layout="Fit" on the <ext:Window> component
    2. Rename the Windows <Content> inner property to <Items>
    3. Remove the <ext:FitLayout> control and nest the <ext:TabPanel> directly within the Windows <Items> inner property.


    The same technique could be applied to your "Action Details" Panel.


    This is just a nice little optimization made available by the v1.0 build.


    Hope this helps.


    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] [1.0] GridPanel resize within Window

    Geoffrey and Vladimir,

    Thanks both for your help - that sorted it.

    Dan

Similar Threads

  1. Resize window to contents/gridpanel?
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Feb 23, 2012, 6:53 AM
  2. [CLOSED] [1.0] GridPanel and Window Resize?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 20, 2010, 1:07 PM
  3. [CLOSED] BUG when resize window
    By smart+ in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 30, 2010, 8:15 AM
  4. [CLOSED] Center window on window resize
    By CSG in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 29, 2009, 5:05 AM
  5. Gridpanel resize with browser window
    By DasPhansom in forum 1.x Help
    Replies: 3
    Last Post: Dec 22, 2008, 12:05 PM

Posting Permissions