[FIXED] [#91] ColumnHeaderGroup HiddenColumns

Page 1 of 2 12 LastLast
  1. #1

    [FIXED] [#91] ColumnHeaderGroup HiddenColumns

    [SENCHA bug ticket is EXTJSIV-6598]
    [4.1.1 rc2] Group Column "hidden: true" doesn't hide its child columns

    [SENCHA bug ticket is EXTJSIV-8115]
    [4.2.0 beta] "hidden: true" of grid column with inner columns causes error

    I used the Group Header Column example again to detail this issue.
    Not sure if you would consider this a bug or if the developer should not assume.

    I have a ColumnHeaderGroup named "Stock Price" that I have added the attribute Hidden="true". The 3 columns under it "Price", "Change" and "Change %" I did not add the attribute Hidden, assuming that it would inherit it from its parent.

    When the form is displayed the hidden ColumnHeaderGroup is not shown but the other data is mis-aligned. I needed to add the attribute Hidden="true" to all the child columns also to make it display properly.

    Your thoughts ...

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = this.Data;
                this.Store1.DataBind();
            }
        }
    
        private object[] Data
        {
            get
            {
                return new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, "9/1 12:00am" }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Grouped Header Example - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" type="text/css" />    
        
        <style type="text/css">
            /* style rows on mouseover */
            .x-grid-row-over .x-grid-cell-inner {
                font-weight: bold;
            }
        </style>
    
        <script type="text/javascript">
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        
        <h1>Grouped Header Example</h1>
        <p>This example shows how to create a grid with column headers which are nested within category headers.</p>
        <p>Category headers do not reference Model fields via a <code>dataIndex</code>, rather they contain
        child header definitions (which may themselves either contain a <code>dataIndex</code> or more levels of headers).</p>
        
        <ext:GridPanel 
            ID="GridPanel1"
            runat="server" 
            Title="Grouped Header Grid" 
            Width="600" 
            ColumnLines="true"
            Height="350">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="company" />
                                <ext:ModelField Name="price" Type="Float" />
                                <ext:ModelField Name="change" Type="Float" />
                                <ext:ModelField Name="pctChange" Type="Float" />
                                <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1" Sortable="false" />
    
                    <ext:Column runat="server" Text="Stock Price" Hidden="true">
                        <Columns>
                            <ext:Column runat="server" Text="Price" DataIndex="price" Width="75" Sortable="true">                  
                                <Renderer Format="UsMoney" />
                            </ext:Column>
                            <ext:Column runat="server" Text="Change" DataIndex="change" Width="75" Sortable="true">
                                <Renderer Fn="change" />
                            </ext:Column>
                            <ext:Column runat="server" Text="Change %" DataIndex="pctChange" Width="75" Sortable="true">
                                <Renderer Fn="pctChange" />
                            </ext:Column>
                        </Columns>
                    </ext:Column>                
                    
                    <ext:DateColumn runat="server" Text="Last Updated" DataIndex="lastChange" Width="85" Sortable="true" Format="dd/MM/yyyy" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    </body>
    </html
    Last edited by cwolcott; Mar 07, 2013 at 1:33 PM.
  2. #2
    Hi,

    I think it's a bug, thanks for the report. I have re-reported it to Sencha and will monitor.
    http://www.sencha.com/forum/showthread.php?223148

    Your workaround to set up
    Hidden="true"
    for the child columns looks the best one for now.
  3. #3
    Thanks for submitting this. I have already added the obvious workaround to all the child columns.
  4. #4
    Sencha has opened a bug ticket.
  5. #5
    Any update regarding this issue?

    I found another workaround: set Visible to false, instead of Hidden to true (Post #1 - Line 90)
  6. #6
    Hello!

    Quote Originally Posted by RCN View Post
    Any update regarding this issue?

    I found another workaround: set Visible to false, instead of Hidden to true (Post #1 - Line 90)
    Thank you for the workaround.

    This bug was fixed by Sencha and patch have been added to ExtJS 4.1.1 and Ext.NET 2.1. However, it seems that there are still some problems with ExtJS 4.2 beta. Therefore, this does not work with Ext.NET from trunk.
  7. #7
    Hello everybody,

    I reported to Sencha.
    http://www.sencha.com/forum/showthread.php?252478

    Opened an Issue to track this defect, see:
    https://github.com/extnet/Ext.NET/issues/91

    Raphael, Visible="false" causes the column not rendered at all. So, it will be absent in the header menu.
  8. #8
    Thank you guys. Please keep me posted about any update regarding this issue.
  9. #9
    Sencha opened a bug ticket.
  10. #10
    Tested the sample code from above against the latest trunk. The children are now hidden if the parent column is hidden, but when it is shown for the first time the layout is incorrect. This was tested in Chrome and IE.

    Click image for larger version. 

Name:	GropuHeader.JPG 
Views:	51 
Size:	26.9 KB 
ID:	5776

    An odd occurrence on IE9,IE8, IE7 is that after the window is displayed and I click on the column header the browser disappears to the back of all other system windows.

    Finally in IE7 when the Column Header Group is not displayed the column seperator is very thick between the data. When the Column Header Group is shown the drop down menu arrow shows with an extra thick border on top and the columns and data do not line up exactly.
    Last edited by cwolcott; Mar 07, 2013 at 8:42 PM.
Page 1 of 2 12 LastLast

Similar Threads

  1. [OPEN] [#96] ColumnHeaderGroup Hideable columns
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 12, 2013, 9:33 AM
  2. Replies: 7
    Last Post: Jul 02, 2012, 6:59 PM
  3. [CLOSED] ColumnHeaderGroup in a TreePanel
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 21, 2012, 3:45 PM
  4. Replies: 1
    Last Post: Nov 16, 2010, 12:53 PM

Posting Permissions