dstore icon indicating copy to clipboard operation
dstore copied to clipboard

Possible limitation with `or` filter

Open kfranqueiro opened this issue 8 years ago • 1 comments

Originally reported in https://github.com/SitePen/dgrid/issues/1265, the following doesn't work as expected.

Given a store with data with IDs 1 through 10:

store.filter(new store.Filter().or(
    new store.Filter().gt('id', 7).lt('id', 10),
    new store.Filter().lt('id', 4).gt('id', 1)
));

This results in a collection with no items, whereas you'd expect it to include IDs 2, 3, 8, and 9..

If you remove the chained filters on each of the arguments to or, it works as expected and matches either one.

I'm not sure yet whether this is a bug or a usage issue.

kfranqueiro avatar Mar 31 '16 23:03 kfranqueiro

I know this is a really old ticket but we're still using dGrid/dStore and dojo 1.17 (hard to go past such a solid reliable framework). We are running into the store filter.or not filtering the expected results correctly (indeed returns all rows, not excluding those not matched with the or entries). Has anyone looked into this at all before we start digging through the filter code?

rgillan avatar Jul 23 '22 06:07 rgillan