Open SpaceK33z opened 7 years ago
Note: think about how to implement filters like '.customer:isnull': true
Some other notes:
'.start_date:range': '2017-01-01,2017-02-01'
? I think addFilter('startDate', ['2017-01-01', '2017-02-01'])
makes sense.store.getFilter('startDate')
, because in the frontend you need to show this data.?deleted=true
, since it doesn't have a leading .
(+ there can be other custom filters)'.customer.location.city': 'Eindhoven'
Another idea, taking into account the notes above:
store.setParam(Params.FILTER_RANGE, 'startDate', [moment(), moment()]);
store.setParam(Params.FILTER_CUSTOM, 'deleted', true);
store.setParam(Params.SORT_ASC, 'pastOwner.lastName');
Problem with this;
store.getParam('pastOwner.lastName')
because that can either be an sorthing or a filter or whatevs.
Sometimes you want to fetch a store from the backend but with some filters applied.
Our Django-Binder stack has a lot of auto-generated filters. To filter a store on a customer id we can do something like this:
For a customer filter the backend has defined it looks about the same;
The syntax for defining this is a bit weird + doesn't use camelCasing. We can perhaps fix it to look like this;