cancel
Showing results for 
Search instead for 
Did you mean: 

In SAPUI5, how to change SmartFilterBar default filter operator as Contains

2,029

In the SAPUI5 application, I need to change SmartFilterBar default filter operator as Contains. But I am not able to do this. Can anyone help me on this

Accepted Solutions (0)

Answers (2)

Answers (2)

geert-janklaps
SAP Mentor
SAP Mentor

Hi,

You can change the presentation / selection variant using annotations.

Presentation / selection variant documentation (change example EQ to CP):

https://ui5.sap.com/#/api/sap.ui.comp.smartfilterbar.SmartFilterBar%23annotations/SelectionVariant

Options are listed here:

https://github.com/SAP/odata-vocabularies/blob/master/vocabularies/UI.md#selectionrangeoptiontype

Best regards,

Geert-Jan Klaps

kammaje_cis
SAP Mentor
SAP Mentor
0 Kudos

You need to add custom data to SmartFilterBar. So this is at SmartFilterBar.

<mvc:View controllerName="cis.mm.controller.List" xmlns:mvc="sap.ui.core.mvc"  xmlns:sfb="sap.ui.comp.smartfilterbar" xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">

<sfb:SmartFilterBar id="listFilterBar" app:useContainsAsDefaultFilter="true">