Results 1 to 5 of 5

Thread: How to delete the data in Store that's already filtered

  1. #1

    Default How to delete the data in Store that's already filtered

    Help me Please

    How to delete the data in Store that's already filtered
    SharpJs.TrPenaltiesStore.filter('DefectId', 'CR01', false, true);
    I got two record where DefectId = CR01 from this filter action
    Then I want to remove the records
    After process that code, all of data except that DefectId = 'CR01' is removed
    I want to keep that data but it's removed from the store and the data that I want to remove is still keep in the store.
    How to handle this? Please help me Thanks

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    store.removeAll() should remove all data, filtered or not filtered.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:

    Posts are my own, not any current, past or future employer's.

  3. #3


    But I don't want to remove all data
    I just want to remove the data that's already filtered and want to keep the others record in the store.
    Still confuse with it
    Because when I read to the store when it's filtered I got the right record (all record that DefectId ='CR01')
    But when I process the .remove function the data that's remove not same with what I read
    The data that's remove from the store is all the data in the store except CR01.
    So after process remove I just got the filtered data. But it's different with what I want.
    Actually I want to remove the record that's already filtered and keep the others, but I got remove the others and keep the filtered record.

  4. #4
    Sencha User
    Join Date
    Jan 2011


    One way of returning the filtered records is by attaching a function to the filtering, as seen in the API documentation:!...-method-filter

    store.filter([  {
        property     : 'name',
        value        : 'Ed',
        anyMatch     : true, //optional, defaults to true
        caseSensitive: true  //optional, defaults to true
      //filter functions can also be passed
        fn   : function(record) {
          return record.get('age') == 24
        scope: this
    In the function, you could simply pass all the returned records to an array, then remove these when required.

  5. #5


    Thanks willigogs
    Your posting really helpful

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