[FIXED] [#247] [2.x] Filters don't work with locked GridPanel

Page 1 of 2 12 LastLast
  1. #1

    [FIXED] [#247] [2.x] Filters don't work with locked GridPanel

    Hi,

    My GridPanel is created dynamically in codebehind from database (Filters/Columns vary). If any column gets locked the GridPanel splits and filters
    only work on locked side. If a column is locked after render it gets the filter as well but as soon as unlocked, filter is gone again.
    After some research we came to the conclusion that somehow the lockedconfig gets the filters but normalconfig doesnt. We tried out all
    workarounds we could find but as an example this just makes filters disappear from locked side as well...

    Ext.override(Ext.grid.Panel, {
                normalCfgCopy: ['invalidateScrollerOnRefresh', 'verticalScroller', 'verticalScrollDock', 'verticalScrollerType', 'scroll', 'features'],
                lockedCfgCopy: ['invalidateScrollerOnRefresh', 'features']
                });
    (also tried defaultvalues + 'features')

    this one throws Null-reference exception (for "NormalGridConfig"):

    [...]
                NewCol.Locked = true;
                [...]
                NewFiltercol.Add(NewFilter);
                [...]
                NewGridPanel.ColumnModel.Columns.Add(NewCol);
                [...]
                NewGridFilters.Filters.AddRange(NewFiltercol);
                            NewGridPanel.Features.Add(NewGridFilters);
                [...]
                NewGridPanel.NormalGridConfig.Features.Add(NewGridFilters);//<== without this line it works (as described) on locked side
                [...]

    Is there a way to get the filters to BOTH (locked and normal) parts of the Grid?

    Best regard
    Thomas
    Last edited by fabricio.murta; Apr 27, 2016 at 12:23 AM.
  2. #2
    Hi Thomas,

    Please clarify what Ext.NET version are you using?

    Generally, I don't think you should do this:
    NewGridPanel.NormalGridConfig.Features.Add(NewGrid  Filters);
    Please try to put just to NewGridPanel.Features.
  3. #3
    Hi Daniil,

    I work with the new 2.2 from SVN, downloaded.
  4. #4
    Hello!

    I've reproduced the problem using the following sample:

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        public class FiltersTestData
        {
            public static List<object> Data
            {
                get
                {
                    List<object> goods = new List<object>
                                    {
                                        new
                                            {
                                                Id = 1,
                                                Company = "3m Co"
                                            }
                                    };
    
                    return goods;
                }
            }
        }
    </script>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = FiltersTestData.Data;
                this.Store1.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html>
        
    <html>
    <head runat="server">
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" DirectEventUrl="default.aspx" SourceFormatting="True" />
        
        <ext:Store runat="server" ID="Store1" PageSize="10">
            <Model>
                <ext:Model runat="server" IDProperty="Id">
                    <Fields>
                        <ext:ModelField Name="Id" Type="Int" />
                        <ext:ModelField Name="Company" Type="String" />
                    </Fields>
                </ext:Model>
            </Model>
            <Sorters>
                <ext:DataSorter Property="Company" Direction="ASC" />
            </Sorters>        
        </ext:Store>
        
        <ext:GridPanel runat="server" Border="false" StoreID="Store1">
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:Column runat="server" Text="ID" DataIndex="Id" />
                            <ext:Column runat="server" Text="Company" DataIndex="Company" Locked="True" />
                        </Columns>
                    </ColumnModel>
                    <Features>
                        <ext:GridFilters runat="server" ID="GridFilters1" Local="true">
                            <Filters>
                                <ext:StringFilter DataIndex="Company" />
                            </Filters>
                        </ext:GridFilters>
                    </Features>
                </ext:GridPanel>
    </body>
    </html>
    We reported to Sencha: http://www.sencha.com/forum/showthread.php?260314
  5. #5
    Sencha opened a bug ticket

    We created issue to track: https://github.com/extnet/Ext.NET/issues/186
  6. #6
    Quote Originally Posted by Baidaly View Post
    Sencha opened a bug ticket

    We created issue to track: https://github.com/extnet/Ext.NET/issues/186
    Hi,

    any news about this issue, I need this function urgently. I want to switch my big project to version 2.2, but without the filters I cannot start.

    Thx Thomas
  7. #7
    Sencha marked it as fixed in 4.2.1. When it is released, we will incorporate it to Ext.NET.
  8. #8

    Issue in grid panel state

    Hello Daniil,
    i have a grid panel with a listener statesave:
    statesave: {
                fn: function(g, state, eOpts){
                    
                }
            },
    If the grid panel contains locked columns, the
    state
    variable not contain
    filters
    object.
    Without locked columns it work fine.
    Is this bug that causes the error?

    Thank you very much.
  9. #9
    Hi @retailItalia,

    Welcome to the Ext.NET forums!

    I think it is another bug. I reported to Sencha.
    http://www.sencha.com/forum/showthread.php?264142

    It is also related to this Issue.
    https://github.com/extnet/Ext.NET/issues/177
  10. #10

    Thanks

    Thank you for your speedy response.
    I must to congratulate with you for your product e your support.
    Ext.net is a great product and very helpfull for my company.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: Apr 16, 2016, 6:54 PM
  2. Replies: 9
    Last Post: Aug 07, 2015, 3:24 PM
  3. Replies: 3
    Last Post: Feb 04, 2015, 5:08 PM
  4. [CLOSED] Tabing through Grid with Locked Column doesn't work...
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 11, 2013, 9:39 PM
  5. Replies: 3
    Last Post: Jan 12, 2012, 3:26 PM

Posting Permissions