Grid rendering within Viewport>TabPanel control

  1. #1

    Grid rendering within Viewport>TabPanel control

    Hi,

    Steps to reproduce it:
    1. Take the GridPanel example from the GridPanel>DataSource Controls>XMLDataSource example.
    2. Add the code to create the GridPanel within a ViewPort>TabPanel (see the attached default.aspx file)
    Result: the grid column headers are not rendered.

    Please note:
    The data source (Plants.xml, Plants.xsl are located in App_Data folder)

    Thank you!

    Marius


  2. #2

    RE: Grid rendering within Viewport>TabPanel control

    It seems that the "bug" is reproduced with IE 7. Under Firefox the grid is displayed as expected.

    Thank you!

    Marius
  3. #3

    RE: Grid rendering within Viewport>TabPanel control

    Hi Marius,

    your example is*oversaturated with layouts and containers (I don't see a much sense in such layout). If you replace CenterLayout by FitLayout and set height for some containers then all will be work (only you loose center align)


    Can you clarify what you want to reach with this markup? May be it is possible to simplify it


  4. #4

    RE: Grid rendering within Viewport>TabPanel control

    Hi Vladimir,

    I agree with you the example may be a little saturated for a simple web application. Currently I am just trying different scenarios to see how the coolite suite of controls are functioning as I am doing a research on a platform to be used for developing Web UI. For some situations there may be a different solution on how to organize the structure of the page and I will try your recommendation.

    What is interesting to find out is the fact that on Firefox and Google Chrome the grid is rendered as expected, but in IE7 there are some issues and I was expecting to find out if there is any "known issue" for this scenario or similar ones.

    Also, in fairly simple application this may not be a problem, but in complex web apps (i.e. a CRM web app) this complexity is quite common and in come situations/views the complexity is even higher.

    Thank you!

    Marius


  5. #5

    RE: Grid rendering within Viewport>TabPanel control

    Hi Marius,

    The *complexity layout is not a problem. Just I said that in your example many layouts which can be removed as*superfluous. For example, I don't see a sense for BorderLayout with only one Center region (you can use FitLayout which is more lite then BorderLayout and doesn't generate any markup, only resize item).


    Please don't hesitate to ask questions about layouts, we always glad to help.


  6. #6

    RE: Grid rendering within Viewport>TabPanel control

    Hi Marius,

    The css used in the <ext:Center> is a little greedy and is cascading down and somehow affecting the GridPanel's layout in IE7.

    I worked around the problem by adding a <ext:FitLayout> around the <ext:GridPanel> and then added the following css class.

    Example

    <style type="text/css">
        #GridPanel1 .x-panel-body {
            text-align: left;
        }
    </style>
    Full .aspx code sample below.

    The complexity of your layout is not a problem. We just need to refine the css for the <ext:CenterLayout> so it doen't center *everything* below it.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataBind();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
        <style type="text/css">
            #GridPanel1 .x-panel-body {
                text-align: left;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
    
            <asp:XmlDataSource 
                ID="XmlDataSource1" 
                runat="server" 
                DataFile="../Shared/Plants.xml"
                TransformFile="../Shared/Plants.xsl" 
                />
                
            <ext:Store runat="server" ID="Store1" DataSourceID="XmlDataSource1">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="Common" />
                            <ext:RecordField Name="Botanical" />
                            <ext:RecordField Name="Light" />
                            <ext:RecordField Name="Price" Type="Float" />
                            <ext:RecordField Name="Availability" Type="Date" DateFormat="m/d/Y" />
                            <ext:RecordField Name="Indoor" Type="Boolean" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <SortInfo Field="Common" Direction="ASC" />
            </ext:Store>
            <ext:ViewPort ID="ViewPort1" runat="server">
                <Body>
                    <ext:CenterLayout ID="CenterLayout1" runat="server">
                        <ext:Panel 
                            ID="Panel1" 
                            runat="server" 
                            AutoScroll="true"
                            BodyStyle="padding:0px 0;">                        
                            <CustomConfig>
                                <ext:ConfigItem Name="width" Value="100%" Mode="Value" />
                            </CustomConfig>
                            <Body>                            
                                <ext:BorderLayout ID="BorderLayout1" runat="server">
                                    <Center>
                                        <ext:TabPanel 
                                            ID="CenterPanel" 
                                            runat="server" 
                                            ActiveTabIndex="1">
                                            <Tabs>
                                                <ext:Tab 
                                                    ID="Tab1" 
                                                    runat="server" 
                                                    Title="Search" 
                                                    Closable="false" 
                                                    Border="false" 
                                                    BodyStyle="padding:6px;">
                                                    <Body>
                                                        <ext:FitLayout runat="server">
                                                            <ext:GridPanel 
                                                                ID="GridPanel1"  
                                                                runat="server" 
                                                                Title="Plants"
                                                                Frame="false" 
                                                                StoreID="Store1">
                                                                <ColumnModel ID="ColumnModel1" runat="server">
                                                                    <Columns>
                                                                        <ext:Column 
                                                                            ColumnID="Common" 
                                                                            Header="Common Name" 
                                                                            DataIndex="Common" 
                                                                            Width="220"
                                                                            Sortable="true" 
                                                                            />
                                                                        <ext:Column Header="Light" DataIndex="Light" Width="130" Sortable="true" />
                                                                        <ext:Column Header="Price" DataIndex="Price" Width="70" Align="right" Sortable="true" />
                                                                        <ext:Column Header="Available" DataIndex="Availability" Width="95" Sortable="true">
                                                                            <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                                                        </ext:Column>
                                                                        <ext:Column Header="Indoor?" DataIndex="Indoor" Width="55" Sortable="true" />
                                                                    </Columns>
                                                                </ColumnModel>
                                                                <SelectionModel>
                                                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                                                </SelectionModel>
                                                                <BottomBar>
                                                                    <ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="10" />
                                                                </BottomBar>
                                                            </ext:GridPanel>
                                                        </ext:FitLayout>
                                                    </Body>
                                                </ext:Tab>
                                                <ext:Tab 
                                                    ID="Tab2" 
                                                    runat="server" 
                                                    Title="Marius Serban" 
                                                    Closable="true"
                                                    Border="false" 
                                                    BodyStyle="padding:6px;">
                                                    <Body>some text</Body>
                                                </ext:Tab>
                                            </Tabs>
                                        </ext:TabPanel>
                                    </Center>
                                </ext:BorderLayout>
                            </Body>                        
                        </ext:Panel>
                    </ext:CenterLayout>
                </Body>
            </ext:ViewPort>
        </form>
    </body>
    </html>
    Hope this helps.

    Geoffrey McGill
    Founder
  7. #7

    RE: Grid rendering within Viewport>TabPanel control

    Hi Geoffrey,

    The workaround you provided helped a lot as the grid has the columns rendered in the proper way in all browsers I tested with.

    Just a small "misalignment" I noticed is: when clicking on the column headers and choose Columns to select/deselect the columns the entries in the drop down menu are not aligned - it's not a big deal for me as I actually don't want to enable that functionality but it may interest you.

    Thank you!

    Marius

Similar Threads

  1. [CLOSED] Version 2.0 Grid not displaying in TabPanel with ViewPort
    By msutton761 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 08, 2012, 10:37 PM
  2. Replies: 1
    Last Post: Mar 08, 2012, 7:45 PM
  3. Replies: 4
    Last Post: Feb 23, 2010, 7:38 AM
  4. Add TabPanel Main Page with Viewport
    By Maia in forum 1.x Help
    Replies: 4
    Last Post: Dec 10, 2009, 10:41 PM
  5. BorderLayout in TabPanel not rendering
    By Washburn in forum 1.x Help
    Replies: 7
    Last Post: May 10, 2009, 8:27 PM

Posting Permissions