'How to modify smartfilterbar filters?
I have defined a smart filter bar like the following:
<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="DamageReportSet" persistencyKey="SmartFilter_Explored" initialized="onFilterInit">
<!-- layout data used to make the table growing but the filter bar fixed -->
<smartFilterBar:layoutData>
<FlexItemData shrinkFactor="0"/>
</smartFilterBar:layoutData>
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="Id" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="true" index="1"/>
<smartFilterBar:ControlConfiguration key="Plant" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="true" index="2" id="plantFilterBox">
<smartFilterBar:defaultFilterValues>
<smartFilterBar:SelectOption low="{appView>/Role/Plantid}"></smartFilterBar:SelectOption>
</smartFilterBar:defaultFilterValues>
</smartFilterBar:ControlConfiguration>
</smartFilterBar:SmartFilterBar>
In some cases the {appView>/Role/Plantid} property is empty. Now the question is how can I modify the smart filter bar and remove the default value or the filter when it is empty!?.
Actually when it is empty it will apply a filter for empty values!
I tried something like this but was not the answer:
onFilterInit: function(oEvent){
this.byId("plantFilterBox").destroyDefaultFilterValues();
oEvent.getSource().clearVariantSelection();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

