Ticket #5510 (closed enhancement: fixed)
dojo.data query supporting OR operations
| Reported by: | guest | Owned by: | jaredj |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | Data | Version: | 1.0 |
| Severity: | normal | Keywords: | data query |
| Cc: |
Description (last modified by jaredj) (diff)
A dojo.data query only supports ANDing clauses together by its nature, but ORing is really necessary in my book. It would be nice to see that implemented, maybe even a SQL syntax (for which you don't need an underlying SQL- driven database, just think of http://search.cpan.org/dist/SQL-Abstract/lib/SQL/Abstract.pm).
But the focus lies on adding OR/NOT/XOR support to a query. Maybe like this:
{ query: { name: { or: ["sam", "tom"] } }
Or maybe:
{query: {name: "sam||tom"} }
More versatile would be an optional user defined callback:
{query: function(item) { return (item["name"] == "sam" || item["name"] == "tom"); } }
Change History
Note: See
TracTickets for help on using
tickets.