1. #1
    Sencha User
    Join Date
    Apr 2011
    Vote Rating
    mahdi.heydari is on a distinguished road


    Default Problems with store filter function

    As stated in store, filter method documentation
    Alternatively, if filters are configured with an id, then existing filters store may be replaced by new filters having the same id.
    But when you look at filter method source code you can see
    me.snapshot = me.snapshot || me.data.clone();
    me.data = me.data.filter(me.filters.items);
    With this code if i have a filter for example with id "x" and filter store with this, then filter store again with another filter with id "x", new filter with id "x" replace with previous filter in "filters" attribute of the store, but result of filter would be join of new "x" and previous "x" filter.
    Developers expect that replacing occur in result too.

  2. #2
    Sencha User watertrac_dev's Avatar
    Join Date
    Jun 2013
    Lawrence, KS
    Vote Rating
    watertrac_dev will become famous soon enough


    Default Fixed in 4.2.0

    I thought I was encountering the same issue in 4.2.0, but inspecting the code shows that this has been resolved:

    me.snapshot = me.snapshot || me.data.clone();
    // Filter the unfiltered dataset using the filter set
    me.data = me.snapshot.filter(me.filters.items);
    The cause of my issue was that I had failed to set the queryMode on my combobox to "local" which was causing an overwrite of the snapshot data.

Thread Participants: 1

Tags for this Thread