In my App I have a Microchart which is directly bound to an OData-Entityset in the XML View.
I now want to pass a Filter to that Request. But this filter should be dynamic based on what settings the user selected.
The user selects a timeframe and this value is then stored in another View Local JSON Model.
Is it possible to build the OData Binding Filter based on that value.
Here the binding with filter which wont work.
I tried various combinations:
- {filterModel>/status}
- {path: 'filterModel>/status' }
<microchart:InteractiveDonutChart id="microDonutChart"
segments="{path: '/BookingStOverviewSet',
filters : [
{ path : 'Txt04',
operator : 'GE',
value1 : {filterModel>/status}
}
]
}">
<microchart:segments>
<microchart:InteractiveDonutChartSegment label="{Txt30}" value="{Count}"/>
</microchart:segments>
</microchart:InteractiveDonutChart>
The logic in the controller to build the JSON Model with the Filter values:
onInit: function () {
var filterModel = new sap.ui.model.json.JSONModel(
{
"startOfCal": new Date(),
"endOfCal": new Date(),
"status": '0001'
});
this.getView().setModel(filterModel, 'filterModel');
}