I am using a grid with a OData data source in combination with a query. The query has a expand keyword in it. The query is executed correclty.
The issue is that if I want to filter a foreign key column, then the executed filter query includes the query from the grid, which in my opinion is wrong. In my expamle I want to load datasource A with a query that expands with object B. But when I filter for a foreign key colum of Type C then the executed query includes the expand(B) which does not even exists on type C. Therefore the request results in an error.
I tried a little bit and also if I put a new dummy Query().where('Id', 'greaterthan', 5) as grid query then the filter query includes this. In this example I want to load items of type A that have an Id > 5. When I want to filter for a foreign column of type B then I do not want to have this filter be applied to that query. The resulting query on type B is Id > 5 which is not what I assumed
Reproduction steps:
- Define a OData data source to a grid
- Add a query to the same grid (preferably use colums inside this filter that are unique to that entity)
- Add a foreign key colum
- Now filter that foreign key column. If the query set in step 2 is invalid for entity of the [dataSource] for that column then the execution fails
- If the query set in step 2 is valid for the entity of the [dataSource] for that column then the result might be wrong
All the best,
Michael Mairegger