[1.0] Codebehind and GridFilters/Remote filtering

  1. #1

    [1.0] Codebehind and GridFilters/Remote filtering

    Hi

    I have a minor issue with gridfilters when trying to set filtering remote using pageProxy
    In local configuration they are working well

    Please note: Most of my controls if not all are build dynamically in code behind not in markup

    My method store_RefreshData is called fine and I get the filters/json string using e.Parameters[_gridFilters.ParamPrefix]) when set and FilterConditions object is also initialized correctly and can be parsed as in the examples
    If I uncheck the filter the data continues to be sent therough
    {"gridfilters":"{\"f_0_field\":\"levform\",\"f_0_data_type\":\"string\",\"f_0_data_value\":\"post\"}"}
    Anyone been messing around with gridfilters in codebehind and can give a clue or two?

    Thanks in advance /Peter
  2. #2
    Hmm I found this thread
    http://forums.ext.net/showthread.php...=remote+filter

    You can use it in the BaseParamsof the Store
     
    <ext:Parameter 
        Name="gridFilters" 
        Value="#{GridPanel1}.getFilterPlugin().buildQuery(
            #{GridPanel1}.getFilterPlugin().getFilterData())" 
        Encode="true" 
        Mode="Raw" />
    I will try this approach and see if it solves my issue

    [EDIT:] Using this approach I get the filterdata I need when active and none when passive

    rgds /Peter
    Last edited by plykkegaard; Jan 30, 2011 at 9:09 PM.
  3. #3

    Clear gridFilters generated from code behind

    Hi,

    Did you figure out a way to clear the filters?

    I too generate my grid and gridfilters from code behind using HttpProxy. However when I filter the grid on screen and want to regenerate the grid, I get an error.

    As a reference, here is how I generate my grid from code behind:
    http://forums.ext.net/showthread.php...sing-HttpProxy

    Any kind of input will be greatly appreciated.

    Thanks.
  4. #4
    What do you mean by "regenerate the grid"? And what kind of error is thrown, do you have a description?

    I am using ext.GridFilters.ClearFilters() in codebehind to remove filters set by the user

    hth /Peter
  5. #5
    Hi,

    Thanks for the response.

    My grid(s) are generated based on a date input and rendered to different tabs within a tabpanel. When the user changes the date input, they need to regenerate the grids. I do a tabpanel.removeAll(true) before calling the directevent that generates the grids but I am still getting an error.

    This is the error that I am getting:
    {"Message":"Invalid web service call, missing value for parameter: \u0027start\u0027.","StackTrace":" at System.Web.Script.Services.WebServiceMethodData.Ca llMethod(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.WebServiceMethodData.Ca llMethodFromRawParams(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.RestHandler.InvokeMetho d(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebS erviceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperat ionException"}

    And when I looked in firebug, the filters don't get cleared somehow.

    Thanks for your help.
  6. #6
    Why do you need to regenerate the grid? Will the gridlayout change eg different fields/columns when the user changes the date?
    If the grid doesnt change take a look at remote filtering/sorting, it's quite easy when you understand the concept

    If you need to create a new grid I think the best way is to do a full roundtrip to the server

    As start examine the parameters you're sending in your direct event, looks something is a bit messy?
    I am using one parameter of the type string containing complex data in json format, I find it easier to control what's going on

    hth /Peter
  7. #7
    I figured out a way around it:

    Set store.Autoload = false;
    Add grid.Listeners.AfterRender.Handler = this.this.getStore().reload({params:{start:0, limit:20}});
    Add grid.Listeners.BeforeDestroy.Handler = this.getFilterPlugin().clearFilters();

    And yes, I need to make a trip back to the server whenever they change the date input.
  8. #8
    Hmm well ok

    I am using PageProxy & Remotesort eq true as in this sample https://examples1.ext.net/#/GridPane..._Sorting/Page/
    But also HttpProxy with Remotepaging and Remotesort eq true as in this example https://examples1.ext.net/#/GridPane...XML_WebService

    From the page is opened by the user and it is closed I am using the same configuration of colums
    The same page can be used for different tables with different number of columns/datatypes/editors etc

    The same page can be opened i different configurations each time in a new tab, if the tab is already opened the tab is selected as the active tab
    I am not resuing the tabs for different grids/content

    rgds /Peter

Similar Threads

  1. Replies: 2
    Last Post: Nov 23, 2011, 12:05 AM
  2. [CLOSED] Remote Filtering through Plugin 'GridFilters' with MVC
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 01, 2011, 3:10 PM
  3. Remote GridFilters via HttpProxy
    By Thinjon100 in forum 1.x Help
    Replies: 1
    Last Post: Sep 19, 2011, 1:39 PM
  4. Extend Gridfilters Remote example with grouping
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Oct 14, 2010, 12:15 PM
  5. remote and local filtering
    By marcmvc in forum 1.x Help
    Replies: 0
    Last Post: Oct 13, 2009, 12:38 PM

Tags for this Thread

Posting Permissions