We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
const store = new Store(); store.params = {'.customer': customer.id }; store.fetch();
For a customer filter the backend has defined it looks about the same;
const store = new Store(); store.params = {'.leaves_for_customer': customer.id }; store.fetch();
The syntax for defining this is a bit weird + doesn't use camelCasing. We can perhaps fix it to look like this;
store.addFilter('leavesForCustomer', customer.id); store.removeFilter('leavesForCustomer');
The text was updated successfully, but these errors were encountered:
Note: think about how to implement filters like '.customer:isnull': true
'.customer:isnull': true
Sorry, something went wrong.
Some other notes:
'.start_date:range': '2017-01-01,2017-02-01'
addFilter('startDate', ['2017-01-01', '2017-02-01'])
store.getFilter('startDate')
?deleted=true
.
'.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')
No branches or pull requests
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;
The text was updated successfully, but these errors were encountered: