Filter expanded OData request

I need to pass a parameter to the backend. I want to use $filter for this. My code below is not working, there are no filters returned by io_tech_request_context->get_filter( )->get_filter_select_options( ) in the Figures entityset.

var aFilters = [ new sap.ui.model.Filter("TeamMembers/Figures/FILTERKEY", sap.ui.model.FilterOperator.EQ,   sFilterValue) ];

    path: "/TeamDataSet('0')",
    parameters: {
     expand: 'TeamMembers/Figures'
    filters: aFilters

1 answer

  • answered 2018-01-05 14:02 boghyon

    Element binding / ContextBinding doesn't support the property filters since you're binding just a single entity and not a collection. If you need to filter Figures, you'll have to bind them to an aggregation (e.g. items on List), get the corresponding ListBinding object, and then call .filter from there.

    Here is a similar example: Take a look at the handler onSearch.