[CLOSED] Store Add Filter

  1. #1

    [CLOSED] Store Add Filter

    Hi,

    i want to use many filters in my GridStore.

    For example i use the Field "WST_ID".

    If i try this, all is OK.

    _ICStore.Store.Filter("WST_ID", "1")

    But I need more Filter.

    For Example

     
    
    Dim _FilterConfig As New DataFilter.Config
    _FilterConfig.Op = "="
    _FilterConfig.RawValue = "1"
    _FilterConfig.Property = "WST_ID"
    
    Dim nDataFilter As New DataFilter(_FilterConfig)
    
    _ICStore.Store.Filters.Add(nDataFilter)
    
    
    
    Dim _FilterConfigSO As New DataFilter.Config
    _FilterConfigSO.Op = "="
    _FilterConfigSO.RawValue = "2"
    _FilterConfigSO.Property = "SO_ID"
    
    Dim nDataFilterSO As New DataFilter(_FilterConfigSO)
    
    _ICStore.Store.Filters.Add(nDataFilterSO)
    I hope you unterstand me.

    Thanks
    Gidi
    Last edited by fabricio.murta; Sep 23, 2021 at 7:50 PM.
  2. #2
    Hello @gidi!

    I'm not sure I can follow just by the bits you provided, but it doesn't look right to filter different IDs in the same column and get any result. It is like saying "I want to show record if ID is 1." Then "I want to show record if ID is two". The first filter would already have "filtered out" the ID=2 in the first iteration. I believe you want to add some logic like "I want ID in [ 1, 2 ]", which you could get with the IN logic.

    Maybe this thread helps you with some alternatives and insight: Filter Store from code behind with IN logic.

    Another good source of information on how filters' logic works would be from Ext JS documentation, a good starting point would be in the Filtering and Sorting section in the Ext.data.Store documentation.

    Here are some examples in our Examples Explorer that are potentially interesting:

    - Data_Binding > Basic > Chaining_Stores
    - GridPanel > Infinite_Scrolling > Remote_Filter
    - GridPanel > Miscellaneous > FilterQuery
    - GridPanel > MultiHeader > Filter
    - GridPanel > Plugins > GridFilters_Local

    If this still doesn't help, I suppose we could use a test case so we could pinpoint what's going on and how to handle it from there.

    Looking forward to your follow-up!
    Last edited by fabricio.murta; Sep 15, 2021 at 4:10 PM.
  3. #3
    Hi Fabricio,

    thanks for your reply.

    Now i use the Store.Filter with FilterQuery.

    For example

      Dim Query As String = "WST_ID = '1'"
      Dim Query2 As String = "SO_ID = '2'"
    
      aktICStore.Store.ClearFilter()
      aktICStore.Store.AddFilter(New FilterQuery(Query))
      aktICStore.Store.AddFilter(New FilterQuery(Query2))
    Thanks for your work
    Gidi
  4. #4
    Hello Gidi!

    Thanks for your feedback, I hope the examples linked helped; thanks also for sharing a brief of what solution fit you best!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 0
    Last Post: Jan 06, 2016, 8:51 AM
  2. Replies: 2
    Last Post: Jan 17, 2011, 3:02 PM
  3. Add date range grid filter
    By stone216 in forum 1.x Help
    Replies: 12
    Last Post: May 24, 2010, 5:32 PM
  4. [CLOSED] Add filter button to grid column header
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 08, 2009, 10:10 AM
  5. [CLOSED] AjaxEvent add filter to GridFilters plugin
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 09, 2009, 12:14 PM

Posting Permissions