Gridpanel Filters issue after refresh

  1. #1

    Gridpanel Filters issue after refresh

    Hello,

    I have an example with a gridpanel with data binded in code behind (C#) to the store and refresh button in the bottom bar of the gridpanel. On click it directs to a direct method in C# that rebind the store of the grid with some new rows. The problem is when I filter a column from the column header menu filter and press refresh a weird behavior of the grid filter is appeared. Please try this code below and check the filter behavior.

    FilterTest.aspx
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    
      <script>
          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 + "%");
          }
    
    
    
    
          //Add a new empty row to the grid and starts editing from the first field.
          var addEmployee = function () {
    
              var grid = App.GridPanel1;
              store = grid.getStore();
    
    
              store.getSorters().removeAll(); // We have to remove sorting to avoid auto-sorting on insert
              grid.getView().headerCt.setSortState(); // To update columns sort UI
    
              store.insert(0, {});
    
              grid.editingPlugin.startEdit(0, 0);
    
    
          };
          //End addEmployee
    
    
          //Remove selected roe from the grid
          var removeEmployee = function () {
    
              var grid = App.GridPanel1,
           sm = grid.getSelectionModel();
    
              grid.editingPlugin.cancelEdit();
              grid.store.remove(sm.getSelection());
              if (grid.store.getCount() > 0) {
                  sm.select(0);
              }
    
          };
          //End removeEmployee
    
    
    
         
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
         <ext:ResourceManager ID="ResourceManager1" runat="server" ShowWarningOnAjaxFailure="false"/>
            <ext:Viewport runat="server" RTL="true" Layout="BorderLayout">
        <Items>
    
                
             <ext:Container runat="server" ID="Container1" Region="North" RTL="true" Cls="ContainerCLS">
                        <Content>
                            <table  runat="server" id="Table1">
                            <tr>
                            <td>
                            <asp:Label ID="Label1" runat="server" Text="text1" />
                            </td>
                            <td>
                            <asp:Label runat="server" ID="TaskcodeLabel" Font-Bold="True" />
                            </td>
                            </tr>
    
                            <tr>
                            <td >
                            <asp:Label ID="Label2" runat="server" Text="text2" />
                            </td>
                            <td>
                            <asp:Label runat="server" ID="customerNo" Font-Bold="True" />
                            </td>
                            </tr>
                          
                            <tr>
                            <td>
                            <asp:Label ID="Label3" runat="server" Text="text3" />
                            </td>
                            <td>
                            <asp:Label runat="server" ID="tasktypeLabel" Font-Bold="True" />
                            </td>
                            </tr>
                            </table>
    
                            <hr />
                         
    
                            <table align="center">
                            <tr>
                            <td >
                            <asp:Label runat="server" ID="TitleR" Text="text4" Font-Bold="True" Font-Size="Large" />
                            </td>
                            </tr>
                            </table>
                            
                          
    
                        </Content>
                    </ext:Container>
    
    
    
    
            <ext:Container runat="server" ID="Container4" Region="Center" RTL="true"  Hidden="true">
                                <Content>
                                     <br />
                                     <div id="mainHolder" style="overflow: auto; max-height: 360px; margin-top:0px; ">
                                    <table align="center" id="mainTable" runat="server" style="width:100%; padding-left:20px; padding-right:20px;">
        
                                    </table>
    
                                    </div>
                            
                                </Content>
            </ext:Container>
    
    
    
            <ext:Container runat="server" Region="Center" ID="Container5">
                <Items>
    
                <ext:GridPanel ID="GridPanel1" runat="server" RTL="true" AutoScroll="true" Title="Grid Row Editor" InvalidateScrollerOnRefresh="false" Height="300"  >
                   <Store>
                    <ext:Store ID="Store1" runat="server" PageSize="80">
                        <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="Size" />
                                    <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                                    <ext:ModelField Name="industry" />
                                    <ext:ModelField Name="desc" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:Column ID="CompanyColumn" runat="server" Text="Company" DataIndex="company" Width="400">
                                <Filter>
                                    <ext:StringFilter />
                                </Filter>
                            </ext:Column>
                            <ext:Column runat="server" Text="Price" DataIndex="Price" Width="250">
                                <Renderer Format="UsMoney" />
                                <Editor>
                                    <ext:NumberField runat="server" />
                                </Editor>
                            </ext:Column>
                            <ext:Column runat="server" Text="Change" DataIndex="change" Width="250">
                            <Renderer Fn="change" />
                            </ext:Column>
                            <ext:Column runat="server" Text="Size" DataIndex="Size" Width="250">
                                <Filter>
                                    <ext:ListFilter DataIndex="Size"/>
                                </Filter>
                            </ext:Column>
                            <ext:DateColumn runat="server" Text="Date" DataIndex="lastChange" Align="Center" Format="M/d hh:mmtt" Width="250">
                                <Filter>
                                    <ext:DateFilter>
                                        <DatePickerOptions runat="server" TodayText="Now" />
                                    </ext:DateFilter>
                                </Filter>
                            </ext:DateColumn>
                               <ext:Column runat="server" Text="industry" DataIndex="industry" Width="250">
                                <Filter>
                                    <ext:ListFilter DataIndex="industry"/>
                                </Filter>
                            </ext:Column>
    
                        </Columns>
                    </ColumnModel>
                    <Plugins>
                        <ext:GridFilters runat="server" />
                    </Plugins>     
                    <BottomBar>
                        <ext:PagingToolbar runat="server"  RefreshHandler="App.direct.RefreshGrid();">
                
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
    
                    </Items>
            </ext:Container>
    
    
    
             <ext:Container runat="server" ID="Container3" Region="South" RTL="true" >
                 <LayoutConfig>
                     <ext:HBoxLayoutConfig Align="Middle" Pack="Center" />
                 </LayoutConfig>
                    <Items>
                        <ext:Button runat="server" ID="Add" Text="Add" Width="100" UI="Success" />
                        <ext:Button runat="server" ID="GridAdd" Text="GridAdd" Width="100" Hidden="true" UI="Success"/>
                        <ext:Button runat="server" ID="Edit" Text="Edit" Width="100" UI="Success" />
                        <ext:Button runat="server" ID="LikeAdd" Text="Like Add" Disabled="true" Width="150" />
                        <ext:Button runat="server" ID="Delete" Text="Delete" Width="100" UI="Danger"/>
                    </Items>
                           
              </ext:Container>
    
    
    
    
            </Items>
    </ext:Viewport>
    
        </form>
    </body>
    </html>
    FilterTest.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    
    namespace FFMS
    {
        public partial class FilterTest : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
    
                };
    
                    this.Store1.DataBind();
                }
            }
    
    
    
            [DirectMethod]
            public void RefreshGrid()
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "3m Co", 71.72, 0.02, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, "Large", "9/1 12:00am", "Finance" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, "Large", "9/1 12:00am", "Services" },
                    new object[] { "AT&T Inc.", 31.61, -0.48, "small", "9/1 12:00am", "Services" },
                    new object[] { "Boeing Co.", 75.43, 0.53, "Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, "Extra-Large", "9/1 12:00am", "Finance" },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, "Extra-Large", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Electric Company", 34.14, -0.08, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "General Motors Corporation", 30.27, 1.09, "Large", "9/1 12:00am", "Automotive" },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, "small", "9/1 12:00am", "Computer" },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, "medium", "9/1 12:00am", "Manufacturing" },
                    new object[] { "Intel Corporation", 19.88, 0.31, "Large", "9/1 12:00am", "Computer" },
                    new object[] { "International Business Machines", 81.41, 0.44, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, "small", "9/1 12:00am", "Medical" },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, "small", "9/1 12:00am", "Finance" },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, "Large", "9/1 12:00am", "Food" },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Pfizer Inc", 27.96, 0.4, "Large", "9/1 12:00am", "Medical" },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, "Large", "9/1 12:00am", "Food" },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, "Large", "9/1 12:00am", "Retail" },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, "small", "9/1 12:00am", "Manufacturing" },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, "medium", "9/1 12:00am", "Computer" },
                    new object[] { "Verizon Communications", 35.57, 0.39, "Large", "9/1 12:00am", "Services" },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, "Large", "9/1 12:00am", "Retail" },
    
       
                };
    
                this.Store1.DataBind();
    
            }
    
    
        }
    }
  2. #2
    Hello @Geovision!

    You sample does not work at all. Can you review it? Maybe you also don't need that long long sample to demonstrate the issue. I see lots of <content> tags and ASP/HTML elements, are they required in order to reproduce the issue? Maybe also being specific on what the strange behavior is would help.

    You may want to review our guidelines for posting samples so we can provide you better feedback. And we have a new guidelines post to try and help with this:

    The code sample you provide should include only the minimum amount of code required to reproduce the issue. Code unrelated to the issue is to be removed. Anyone should be able to copy + paste your sample into a local Visual Studio test project and run without having to make modifications.

    Tips for creating simplified code samples

    If Exceptions or syntax errors are thrown when testing your code sample, we'll let you know so you can revise your original sample. Then we'll review again with the updated sample.
    We hope to hear back from you soon!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello here is a simplified code sample:

    Aspx Page:
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
     <script>
         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>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
    
            <ext:GridPanel
                ID="GridPanel1"
                runat="server"
                Title="Array Grid"
               >
                <Store>
                    <ext:Store ID="Store1" runat="server" PageSize="10">
                        <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" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:RowNumbererColumn runat="server" Width="35" />
                        <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1">
                            <Filter>
                                <ext:StringFilter DataIndex="company" />
                            </Filter>
                        </ext:Column>
                        <ext:Column runat="server" Text="Price" Width="75" DataIndex="price">
                            <Renderer Format="UsMoney" />
                            <Filter>
                                <ext:StringFilter DataIndex="price" />
                            </Filter>
                        </ext:Column>
                        <ext:Column runat="server" Text="Change" Width="75" DataIndex="change">
                            <Renderer Fn="change" />
                            <Filter>
                                <ext:ListFilter DataIndex="change" />
                            </Filter>
                        </ext:Column>
                        <ext:Column runat="server" Text="Change" Width="75" DataIndex="pctChange">
                            <Renderer Fn="pctChange" />
                            <Filter>
                                <ext:ListFilter DataIndex="change" />
                            </Filter>
                        </ext:Column>
                        <ext:DateColumn runat="server" Text="Last Updated" Width="125" DataIndex="lastChange" Format="H:mm:ss" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel runat="server" Mode="Multi" />
                </SelectionModel>
                <View>
                    <ext:GridView runat="server" StripeRows="true" />
                </View>
                <Plugins>
                    <ext:GridFilters runat="server" />
                </Plugins>
                <BottomBar>
                     <ext:PagingToolbar runat="server" RefreshHandler="App.direct.RefreshGrid();">
                        <Items>
                            <ext:Label runat="server" Text="Page size:" />
                            <ext:ToolbarSpacer runat="server" Width="10" />
                        </Items>
                        <Plugins>
                            <ext:ProgressBarPager runat="server" />
                        </Plugins>
                    </ext:PagingToolbar>
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>

    C# Code:
    protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                   DateTime now = DateTime.Now;
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, now },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, now },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, now },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, now },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, now },
                    new object[] { "AT&T Inc.", 31.61, -0.48, -1.54, now },
                    new object[] { "Boeing Co.", 75.43, 0.53, 0.71, now },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, now },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, now },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, now },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, now },
                    new object[] { "General Electric Company", 34.14, -0.08, -0.23, now },
                    new object[] { "General Motors Corporation", 30.27, 1.09, 3.74, now },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, -0.08, now },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now },
                    new object[] { "Intel Corporation", 19.88, 0.31, 1.58, now },
                    new object[] { "International Business Machines", 81.41, 0.44, 0.54, now },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now },
                    new object[] { "Pfizer Inc", 27.96, 0.4, 1.45, now },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now },
                    new object[] { "Verizon Communications", 35.57, 0.39, 1.11, now },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now }
                   
       
                };
    
                this.Store1.DataBind();
                }
            }
    
    
    
            [DirectMethod]
            public void RefreshGrid()
            {
                DateTime now = DateTime.Now;
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, now },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, now },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, now },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, now },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, now },
                    new object[] { "AT&T Inc.", 31.61, -0.48, -1.54, now },
                    new object[] { "Boeing Co.", 75.43, 0.53, 0.71, now },
                    new object[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, now },
                    new object[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, now },
                    new object[] { "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, now },
                    new object[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, now },
                    new object[] { "General Electric Company", 34.14, -0.08, -0.23, now },
                    new object[] { "General Motors Corporation", 30.27, 1.09, 3.74, now },
                    new object[] { "Hewlett-Packard Co.", 36.53, -0.03, -0.08, now },
                    new object[] { "Honeywell Intl Inc", 38.77, 0.05, 0.13, now },
                    new object[] { "Intel Corporation", 19.88, 0.31, 1.58, now },
                    new object[] { "International Business Machines", 81.41, 0.44, 0.54, now },
                    new object[] { "Johnson & Johnson", 64.72, 0.06, 0.09, now },
                    new object[] { "JP Morgan & Chase & Co", 45.73, 0.07, 0.15, now },
                    new object[] { "McDonald\"s Corporation", 36.76, 0.86, 2.40, now },
                    new object[] { "Merck & Co., Inc.", 40.96, 0.41, 1.01, now },
                    new object[] { "Microsoft Corporation", 25.84, 0.14, 0.54, now },
                    new object[] { "Pfizer Inc", 27.96, 0.4, 1.45, now },
                    new object[] { "The Coca-Cola Company", 45.07, 0.26, 0.58, now },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now },
                    new object[] { "Verizon Communications", 35.57, 0.39, 1.11, now },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now },
                    new object[] { "The Home Depot, Inc.", 34.64, 0.35, 1.02, now },
                    new object[] { "The Procter & Gamble Company", 61.91, 0.01, 0.02, now },
                    new object[] { "United Technologies Corporation", 63.26, 0.55, 0.88, now },
                    new object[] { "Verizon Communications", 35.57, 0.39, 1.11, now },
                    new object[] { "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, now }
                };
    
                this.Store1.DataBind();
    
            }
    If you filter a column and press refresh. the data will be refreshed and the column still marked filtered but if you opent the header menu the checkbox is not chekced and if you try to check it and uncheck it no data wil be found.
    Try It Please.
    Thank you
    Last edited by Geovision; Jun 13, 2016 at 5:38 AM.
  4. #4
    Hello!

    Nice, the example works!

    But well, I don't reproduce the problem exactly as you say.

    Actually yes, the check-box on the column filter is unchecked but, when I check it, it keeps the selection and, de-selecting it again makes all entries be displayed.

    What I tried here, step by step:
    - load the page, 29 entries in the grid
    - apply a filter in the 'Company' column: "The"
    - Get 3 results (Coca-Cola, Home Depot, and Procter)
    - Click refresh
    - Now 5 results, home depot and procter repeat in the end of the list
    - Tick the filter checkbox.
    - Same 5 results, no visual change other than the checkbox being marked
    - Un-tick the filter checkbox.
    - Now, 34 entries.

    Maybe you need to provide exact steps you took to reproduce the issue on your side. Are you using a specific web browser during your tests?
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello,
    The problem is that the filters are not reset only by checking and un-checking the combobox again, If you delete the entry in the filter text field nothing is changed while this is not user firendly; user want to clear the text field and not check and uncheck the checkbox to get all data again.
    Also Please try the filter on the Column "Change" (The first Column "Change" to be specific) it is a ListFilter these are the steps below:

    - load the page, 29 entries in the grid
    - apply a filter in the 'Change' select "-0.48"
    - Before refresh reopen teh filter menu all list Items exists and appear to the user
    - Get 1 result (At&T)
    - Open the filter menu, only the selected list item exist ("-0.48") and the others items do not appear to user since he check and uncheck the filter checkbox.
    Also this is not user friendly.


    The two cases mentioned aboce are not User firendly because when the user first open the system with the grid and before the refresh, he will be using the filter menu differently than after refresh unless he will check and uncheck the Filter Combobox

    Thank you.
  6. #6
    Hello again, @Geovision!

    The filters are not bound to the refresh call you make in your refresh button handler code. Just add an instruction to reset the filters and you'll get it working just fine!

    <ext:PagingToolbar runat="server" RefreshHandler="App.direct.RefreshGrid(); App.gf1.clearFilters();">
    This way, every time an user clicks 'refresh', the filters will be deactivated accordingly -- but the chosen/written entry in the filter will be kept so just checking the box enables the filter again.

    Or, do you require to retain the filters -and- the visual checkboxes?
    Fabrício Murta
    Developer & Support Expert
  7. #7
    Hello again,
    yes Please if there is a way to retain the filter and the visual checkboxes after the refresh.
    Thank you
  8. #8
    Hello @Geovision!

    I'd suggest you to get the filters on refresh (from App.gf1.store.getFilters().items) and then check the menu boxes programmatically (with App.gf1.filterMenuItem.GridPanel1.setChecked(true)) when you refresh.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  9. #9
    Yes, manual re-checking might be a solution, but I've found out the reason of the behavior and it looks like there is a chance to correct the behavior.

    Please try these overrides adding them into the page's head. If it works well for you, we might consider incorporating it into the sources.

    Possible Fix
    <script>
        Ext.data.PagingStore.override({
            privates: {
                onBeforeLoad: function () {
                    var filters;
    
                    //this.callParent(arguments);
                    this.callSuper(arguments);
    
                    if (this.data.filtered) {
                        filters = Ext.clone(this.getFilters().getRange());
                        // Required for UI filters
                        this.preventUIFilterRemoval = true;
                        this.clearFilter(true);
                        this.on("load", function () {
                            this.setFilters(filters);
                            // Removing flag
                            delete this.preventUIFilterRemoval;
                        }, this, { single: true });
                    }
                }
            }
        });
    
        Ext.grid.filters.filter.SingleFilter.override({
            onFilterRemove: function () {
                // Don't remove if PagingStore is restoring filters
                if (!this.grid.store.preventUIFilterRemoval) {
                    this.callParent(arguments);
                }
            }
        });
    
        Ext.grid.filters.filter.TriFilter.override({
            onFilterRemove: function () {
                // Don't remove if PagingStore is restoring filters
                if (!this.grid.store.preventUIFilterRemoval) {
                    this.callParent(arguments);
                }
            }
        });
    
        Ext.grid.filters.filter.List.override({
            onDataChanged: function() {
                // Don't update filter options if PagingStore is restoring filters
                if (!this.grid.store.preventUIFilterRemoval) {
                    this.callParent(arguments);
                }
            }
        });
    </script>

Similar Threads

  1. [CLOSED] GridPanel periodical refresh with filters
    By Geovision in forum 3.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 11, 2016, 3:20 PM
  2. Replies: 3
    Last Post: Jun 15, 2015, 1:21 PM
  3. Gridpanel Filters Language
    By smyy in forum 3.x Help
    Replies: 5
    Last Post: Feb 27, 2015, 12:15 PM
  4. GridPanel Refresh data issue
    By Miyo in forum 2.x Help
    Replies: 1
    Last Post: Jul 09, 2014, 6:05 PM
  5. Replies: 3
    Last Post: Jan 12, 2012, 3:26 PM

Posting Permissions