[CLOSED] GridPanel Hidden Column

  1. #1

    [CLOSED] GridPanel Hidden Column

    There seems to be a problem with columns that are hidden in grid panels. So in the behind code the standard configuration is:

    <ext:NumberColumn runat="server" Text="CFDB Version" DataIndex="CfdbVer" Width="75" Align="Center" Hidden="True" Format="00" />
    When the browser displays the GridPanel I select Columns->CFDB Version to display the column, but when I go back to hide it the Columns->CFDB Version is greyed out.

    I performed an additional text by defining a second column to be hidden. And again I can enable either column to be shown via the browser, but I can not select them to be hidden unless both a selected to be shown.

    I assume there is a counter problem in the ext.net code.
    Last edited by Daniil; Aug 27, 2012 at 7:57 AM. Reason: [CLOSED]
  2. #2
    Here is some additional details.

    I configured my five columns in the following manner:

    C1 - hidden=true;
    C2 - hideable=false;
    C3 - hideable=false;
    C4 - hideable=false;
    C5 - hideable=false;

    If you look at the typical GridPanel it will not let you hide the last column. So since I have 4 columns that are not hideable only C1 shows in the list and it will not let me re-hide the column.
  3. #3
    Hi Chris,

    Thanks for the report. We will investigate.

    Here is the example to reproduce.

    Example
    <%@ 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)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3" },
                    new object[] { "test4", "test5", "test6" },
                    new object[] { "test7", "test8", "test9" },
                };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="test1" />
                                <ext:ModelField Name="test2" />
                                <ext:ModelField Name="test3" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Test1" DataIndex="test1" Hidden="true" />
                    <ext:Column runat="server" Text="Test2" DataIndex="test2" Hideable="false" />
                    <ext:Column runat="server" Text="Test3" DataIndex="test3" Hideable="false" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    </body>
    </html>
  4. #4
    Any update on this issue?
  5. #5
    I will report it to Sencha.

    For now I can suggest the following fix.

    Fix
    <script type="text/javascript">
        Ext.grid.header.Container.override({
            getLeafMenuItems: function() {
                var me = this,
                    columns = me.getGridColumns(),
                    items = [],
                    i = 0,
                    count = 0,
                    len = columns.length,
                    menu = me.getMenu(),
                    item;
                
                for (; i < len; ++i) {
                    item = columns[i];
                    if (item.hideable) {
                        item = me.getMenuItemForHeader(menu, item);
                        if (item) {
                            items.push(item);
                            if (item.checked) {
                                ++count;
                            }
                        }
                    // THE FIX
                    } else if (!item.hidden) {
                        ++count;  
                    }
                    // END OF THE FIX
                }
            
                return {
                    items: items,
                    checkedCount: count    
                };
            }
        });
    </script>
  6. #6
  7. #7
    Thanks. The patch works great for my issue.
  8. #8
    The patch works great. You can close this thread. Hopefully Sencha will fix it on their end.
  9. #9
    Thanks for the update.

    I would leave the thread unclosed for now till a permanent fix will appear either in ExtJS or Ext.NET.
  10. #10
    Sencha appears to fixed it. I think you can remove the patch now.

    Thanks again for the report!

Similar Threads

  1. [CLOSED] Problem with Gridpanel Column's Hidden Property
    By mohan.bizbites in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 05, 2012, 5:43 AM
  2. get value of hidden column with command onevent
    By HaamSapTjai in forum 1.x Help
    Replies: 2
    Last Post: Mar 20, 2012, 3:46 PM
  3. [CLOSED] Make an Ext.Column truly hidden
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 10, 2011, 9:53 PM
  4. Replies: 1
    Last Post: Sep 02, 2010, 3:59 PM
  5. Replies: 3
    Last Post: Aug 15, 2009, 2:55 PM

Posting Permissions