Results 1 to 5 of 5

Thread: Remove a single filter from a store which has multiple filters

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    2
      0  

    Default Remove a single filter from a store which has multiple filters

    Hey guys,

    I have a store with multiple filters, how can i remove a single one of them instead of using store.clearFilter(), which ofcourse clears all of them?
    Can't find anything in the docs or any other examples (was expecting removeFilter() or something)..

    Thanks in advance,

    rmaas

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    Remove filters and filter the store again.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    2
      0  

    Default

    Thanks for your reply, i figured there would be a function for it.. Is there any obvious reason why it isn't implemented?

  4. #4
    Sencha User grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155
    Answers
    10
    Vote Rating
    26
      0  

    Default

    Ext.data.Store.prototype.filters (or store.filters in your instance) is an array of objects representing the applied filters. Try interrogating it and work from there
    <div style="float: left; width: 70px;">http://appac.us/mcs.png</div><div style="float: left; height: 100px;">Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur</div><div style="clear:both;"></div>

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    2
      1  

    Default

    Quote Originally Posted by grgur View Post
    is an array of objects
    Yeah but wouldn't it make sense to have a remove function? Seems a bit weird to remove everything and manually add the remaining objects..

    If you take a look at the store object as example:
    - store.remove() accepts either a model or an array of models..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •