[CLOSED] GridFilter unchecked, but filter still applied

  1. #1

    [CLOSED] GridFilter unchecked, but filter still applied

    I am using an HttpProxy with remote paging/sorting/filtering.

    The problem I am having is that you can apply a filter (using GridFilters plugin), and you can see the GridFilters param gets passed to the HttpProxy URL i.e.:
    gridfilters    {"f_0_field":"Group","f_0_data_type":"string","f_0_data_value":"test"}
    However, if you uncheck the filter in order to remove the filter, the gridfilters param is still sent (identical to above).

    I would think that if you do not check the box for the filter, that the filter should be inactive, correct?

    Also, the value entered into the filter is not cleared when unchecking the filter.

    If I have more than 1 filter checked, unchecking one of the filters removes that filter from the gridfilters param passed to the HttpProxy - so this bug only occurs when it's there's only 1 filter checked and you uncheck that filter.
    Last edited by Daniil; Mar 13, 2012 at 5:36 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Moving to the Premium Help 1.x forum.

    Please ask any technical support questions on the Premium Help forums since you are a premium member. We can miss your question on the other forums.
  3. #3
    I was unable to reproduce the problem. Here is my test case.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        public List<object> MyData = new List<object> 
        { 
            new { test = "test1" },
            new { test = "test2" },
            new { test = "test3" },
            new { test = "test4" },
            new { test = "test5" },
            new { test = "test6" },
            new { test = "test7" },
            new { test = "test8" },
            new { test = "test9" }
        };
    
        protected void Store_RefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            List<object> data = this.MyData;
            var limit = e.Limit;
            if ((e.Start + e.Limit) > data.Count)
            {
                limit = data.Count - e.Start;
            }
            List<object> rangeData = (e.Start < 0 || limit < 0) ? data : data.GetRange(e.Start, limit);
            e.Total = data.Count;
            (sender as Store).DataSource = rangeData;
        }
    </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 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store runat="server" OnRefreshData="Store_RefreshData">
                        <Proxy>
                            <ext:PageProxy />
                        </Proxy>
                        <Reader>
                            <ext:JsonReader>
                                <Fields>
                                    <ext:RecordField Name="test" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                        <BaseParams>
                            <ext:Parameter Name="start" Value="0" Mode="Raw" />
                            <ext:Parameter Name="limit" Value="3" Mode="Raw" />
                        </BaseParams>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test" DataIndex="test" />
                    </Columns>
                </ColumnModel>
                <Plugins>
                    <ext:GridFilters runat="server">
                        <Filters>
                            <ext:StringFilter DataIndex="test" />
                        </Filters>
                    </ext:GridFilters>
                </Plugins>
                <BottomBar>
                    <ext:PagingToolbar runat="server" PageSize="3" />
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Also, the value entered into the filter is not cleared when unchecking the filter.
    Yes, there is no such functionality. A value stays, because it can be useful for a user. You could clear it manually.
  4. #4

    suggestion

    can you try a test case that uses an HttpProxy?
  5. #5
    I've tried with:
    https://examples1.ext.net/#/GridPane...ilters_Remote/
    getting the same.

    Are you able to reproduce the problem with that example?
  6. #6

    http proxy

    this is still using a pageproxy not an httpproxy....i will work on putting together an httpproxy test case
  7. #7
    Oh, yes, I was sure there is an HttpProxy.

    i will work on putting together an httpproxy test case
    It would be best.
  8. #8
    Click image for larger version. 

Name:	Untitled-1.gif 
Views:	143 
Size:	55.5 KB 
ID:	3899

    it's issuing a request, true, but it's using a directevent with a pageproxy instead of an httpproxy with a .ashx file
  9. #9
    Yes, I see, thanks.
  10. #10
    I was unable to reproduce the issue with HttpProxy as well.

    Her is my test case.

    Example Page
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!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 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store runat="server">
                        <Proxy>
                            <ext:HttpProxy Url="Test.ashx" />
                        </Proxy>
                        <Reader>
                            <ext:JsonReader Root="Data" TotalProperty="TotalRecords">
                                <Fields>
                                    <ext:RecordField Name="test" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                        <BaseParams>
                            <ext:Parameter Name="start" Value="0" Mode="Raw" />
                            <ext:Parameter Name="limit" Value="3" Mode="Raw" />
                        </BaseParams>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test" DataIndex="test" />
                    </Columns>
                </ColumnModel>
                <Plugins>
                    <ext:GridFilters runat="server">
                        <Filters>
                            <ext:StringFilter DataIndex="test" />
                        </Filters>
                    </ext:GridFilters>
                </Plugins>
                <BottomBar>
                    <ext:PagingToolbar runat="server" PageSize="3" />
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Example Handler
    using System;
    using System.Collections.Generic;
    using System.Web;
    using Ext.Net;
     
    namespace Work
    {
        public class Test : IHttpHandler
        {
            public List<object> MyData = new List<object> 
                { 
                    new { test = "test1" },
                    new { test = "test2" },
                    new { test = "test3" },
                    new { test = "test4" },
                    new { test = "test5" },
                    new { test = "test6" },
                    new { test = "test7" },
                    new { test = "test8" },
                    new { test = "test9" }
                };
    
            public void ProcessRequest(HttpContext context)
            {
                int start = int.Parse(context.Request["start"]),
                    limit = int.Parse(context.Request["limit"]);
    
                ;
                context.Response.Write(JSON.Serialize(new Paging<object>(MyData.GetRange(start, limit), 9)));
                context.Response.End();
            }
     
            public bool IsReusable
            {
                get { return false; }
            }
        }
    }

Similar Threads

  1. Replies: 2
    Last Post: Nov 25, 2011, 4:47 PM
  2. [CLOSED] GridFilter Remote ComboBox filter
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 17, 2011, 3:20 PM
  3. [CLOSED] Dynamically set filter value in GridFilter
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 05, 2010, 2:58 PM
  4. GridFilter, Alter name of filter
    By flaviodamaia in forum 1.x Help
    Replies: 0
    Last Post: Jun 05, 2009, 11:39 AM
  5. How to get unchecked row in gridpanel
    By tangcan2003 in forum 1.x Help
    Replies: 2
    Last Post: Apr 21, 2009, 1:35 AM

Tags for this Thread

Posting Permissions