Replies: 2 comments 2 replies
-
I'm not exactly sure what you mean by parsing the filter query but the Example 10 - GraphQL already shows multiple filters as presets which is what I've done in the past for our project. I mean don't you already know the Ids that you need to preset before opening the grid? Filtering the query string should be last resource |
Beta Was this translation helpful? Give feedback.
-
Here's what we do in our app. We have some components that route to other components (using anchors, buttons, etc) using a Easier to explain with an example/code. Imagine a list of accounts and you want to zoom into the transactions of a selected account. accounts.component.ts: public transactionFilters: CurrentFilter[] = [{ columnId: 'account/code', operator: '=', searchTerms: [selectedAccountCode] }] accounts.component.html: <a [routerLink]="['/transactions']" [queryParams]="{ filters: transactionFilters | json }" Clicking the link you get: (url decode the filters query parameter to get the json) transactions.component.ts
About the oData part in your question. It's of course up to you to decide what API your grid component wants to expose to the outside world. Personally, I wouldn't use oData in that interface for a few reasons:
|
Beta Was this translation helpful? Give feedback.
-
Hey ho, I wonder whether any of you @ghiscoding and @jr01 ever had the requirement to actually parse an odata or graphql filter query so that you can preset your default grids filters.
our use case is to open a grid, prefiltered with one or multiple ids from a link in a powerbi report.
I made a somewhat hacky approach by regexing the querystring filter for specific col eq xyz cases but wondered whether you guys had different approaches
Beta Was this translation helpful? Give feedback.
All reactions