Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    118
    Vote Rating
    12
    corvonero will become famous soon enough

      0  

    Default store and filters lifecycle...

    store and filters lifecycle...


    If you definine a store with a filter like the following:

    Code:
    filters: {
                    property: 'active',
                    value: true
                }
    Data loaded from server is correctly filtered and that's ok.
    But if you add a new record to the store which has "active:false" the record appears in the store.
    If a grid uses that store, the record is immediately visible.
    IMHO, this is wrong (unless I am doing something very strange...)

    Nothing changes if the store is synced to the server.

    I think that if a store has a filter, it should be filtering on every data change.

    Has this been considered and discarded? Is it too CPU consuming?
    What's the rationale behind the filters behaviour?

    M.

  2. #2
    Sencha User
    Join Date
    Dec 2007
    Posts
    118
    Vote Rating
    12
    corvonero will become famous soon enough

      0  

    Default


    And, btw, I just "discovered" that calling store.filter(); fires the datachanged event.
    So if you filter on datachange, you get in a loop.

    What should one do then in order to keep the filters active?