1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    18
    Vote Rating
    0
    Olaus is on a distinguished road

      0  

    Default Unanswered: Filter a store?

    Unanswered: Filter a store?


    How do I filter a store?
    In gxt 2 i could do store.filter(property); But that is removed.
    applyFilters is protected. Should that be public like applySort?

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Are you wanting to set a bunch of filters and then execute the search/sort?

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    18
    Vote Rating
    0
    Olaus is on a distinguished road

      0  

    Default


    Yes. I set a filter to a store. The filter depends an external property (date). So I want to rerun the filter when the date changes. I don't want to remove/add the filter in order to run it.

  4. #4
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    I need to do this as well because my filters are separate from my grid, i.e., the fields used to specify filter values are in a toolbar above the grid. The toolbar has a "Search" and "Reset Search" button.

    The answer I got is that the filtering is done on the ListStore but I am awaiting some answers on how exactly to do this because the addFilter method on ListStore takes a StoreFilter and not a StringFilter or NumericFilter, etc...

    The other issue is that the child classes of Filter do not allow you to set the value directly. I mitigated this by extending, e.g., StringFilter and adding a setValue() method. This way you can set the value(s) and then fire an update event.

    I should hear back today and I can update this thread with the answer I received. Until then, I'm just playing around to see what works.

  5. #5
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      1  

    Thumbs up


    Ok, I never heard back but I got this working. Note that I disable the menus that display in the column headers - this is done via the ColumnConfig. Also, this assumes you are doing all your filtering and sorting on the server-side.

    For setup, I constructed a new GridFilters<M> object passing in my FilterPagingLoadConfig and then called GridFilters.initPlugin passing in a reference to my grid. Finally, I iterated over my filters calling GridFilters.addFilter for each one.

    I retained a reference to each of my filters (NB: which does not scale) and I have each one mapping to a corresponding form field (text field, combo box, etc...).

    Because filters don't allow me to set the value directly, I had to extend the base classes to add a method to do so, however, I think if I call Filter.getValueProvider I can call the setter method there to set the value, but I've not tested this yet.

    When I click my "Search" button, I check each form field to see if it has deviated from it's default value and if it has changed, I call Filter.setActive(true, true) and then call the method I added to set the value on the filter.

    Finally, calling PagingLoader.load will fire the AJAX call to the server and my service method (which takes a FilterPagingLoadConfig object as its parameter). Calling FilterPagingLoadConfig.getFilters returns me my list of set filters in the form of FilterConfig objects.

    I know I glossed over this, so if you need concrete examples, first look at the source code for the Remote Filter Grid here: http://sencha.com/examples-dev and I can provide snippets of my code.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi