(4.1) Should store.add respect filters?

Hi,

I have a memory store which an asynchronous ajax call occasionally adds records to. This store can be configured at run-time with filters and sorts and is backing a grid.

The problem is that if I add a record (store.add(..)) which doesn't match the current filter it is still displayed on the grid. Calling store.filter() hides it, but it also unfortunately resets any groupings (expanded/collapsed) and scroll co-ordinates.

It if helps, imagine I am building a grid which display server side log messages. It is updated every N seconds by an Ajax call which manually updates the store. The GUI allows you to filter messages though - maybe you only want to see SEVERE messages for example.

So my question is, how can I add a record to a (memory) store which is backed by a grid with filters so the grid only shows that item if it matches the current filter without losing the scroll and group state?

My query still stands - when calling store.add() on a grid's store, should a record appear on the grid if it doesn't match the filter? My experiments indicate that the record does still appear until store.filter is called.

To be clear, I have a memory backed store, and a grid with a simple filter of "departmentId"=5. If I add a record {name:'hi-ho',departmentId:10} then it will appear on that grid until I call store.filter(). Is that expected behaviour?

I have found that if I have a record which *does* match a filter and then I update it so that it no longer matches the filter it is still (incorrectly) displayed in the grid, even after a store.filter(). Adding a new record does the right thing, so instead of updating it I remove and re-add it:

I think that this is a bug as adding an non matching record to the store should filter it automatically. In the following showcase, when you click 'Re-filter' button the simple store.filter() is called that hides the such records. As a workaround you can install add listener and just call the filter after add.