[CLOSED] Remote filtering via AjaxProxy and ASHX handler vs Page Proxy and Store's OnReadData event

  1. #1

    [CLOSED] Remote filtering via AjaxProxy and ASHX handler vs Page Proxy and Store's OnReadData event

    Hi,

    Your Grid with Remote Filtering example is useful:
    https://examples2.ext.net/#/GridPane...ilters_Remote/

    When I opt to use an AjaxProxy with an ASHX handler instead, I can create an instance of StoreRequestParameters based on the context.

    So I can do something like this (where CompanyData is the object I am working with):
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "application/json";
    
        var requestParams = new StoreRequestParameters(context);
    
        int start = requestParams.Start;
        int limit = requestParams.Limit;
    
        Paging<CompanyData> data = GetData(start, limit);
    
        context.Response.Write(JSON.Serialize(data));
    }
    I was hoping to instantiate the same FilterConditions you do in your example above.

    I can get the start, limit and other such properties off the StoreRequestParameters, but, when it comes to the Filter property, instead of being a string (or an already instantiated FiltersCondition class), the filter property is an array of DataFilter classes. Furthermore, that DataFilter doesn't contain things like which operator was selected (greater than, etc) - only the value. It looks like DataFilter is really a class used to help construct a component, rather than represent a request parameter?

    So, what I find I need to do instead is read it off the querystring manually like this

    var filterConditions = new FilterConditions(context.Request["filter"]);
    This is fine, but for the book chapter on this, I'd probably need to explain to a reader why we can't get this off the StoreRequestParameters like the rest of the properties. Come to think of it could the filter also be added to it? Maybe as an already-instantiated FilterConditions instance (or null if no filters set)? If the current Filters property is needed on the StoreRequestParameters class then maybe another property could be added called FilterConditions of type FilterConditions?

    Thanks!
    Last edited by Daniil; Jun 04, 2012 at 7:36 AM. Reason: [CLOSED]
  2. #2
    Filter property of StoreRequestParameters is used for standard store's filters (if remoteFilter is true) and match the following class
    http://docs.sencha.com/ext-js/4-1/#!...xt.util.Filter

    Filter property is not related with GridFilters plugin at all
    I don't think that including FilterConditions to the StoreRequestParameters class is good idea becauce GridFilters is plugin (not part of standard framework and store)
  3. #3
    Thanks for replying over the weekend. You are of course right - that was a silly question from me in hindsight! Got grids stuck in my head :)

    I can create always create a subclass for my purposes, to wrap this if I want.

Similar Threads

  1. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  2. Replies: 0
    Last Post: Jun 03, 2012, 3:46 AM
  3. [CLOSED] Remote filtering is not working with proxy
    By Aparna_B in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 23, 2011, 10:49 AM
  4. [CLOSED] Correct DirectResponse from an ashx handler
    By anup in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 30, 2011, 10:58 AM
  5. Replies: 0
    Last Post: Mar 21, 2011, 3:55 PM

Posting Permissions