cancel
Showing results for 
Search instead for 
Did you mean: 

Change SmartFilterBar default filter operator

michaela_schlage
Explorer

Hi @all,

this is a question from a customer.

When typing something in a filter of the SmartFilterBar the value is automatically marked with filter operator equal. Now customer is asking if its possible to change the filter operator to contains by default.

So in short customer is too lazy to type *xxxx* on himself. He wants this behaviour by default.

I looked a lot in the SapUI5 documentation and could only find how to set a default filter to one filter field. But could not find a solution to change the default filter operator on all filter fields.

Maybe somebody has an idea?

RaminS
Participant
0 Kudos

Agreed. We need SAP to make this an option.

My clients are asking for it.

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
Active Contributor

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">
RaminS
Participant
0 Kudos

How do we do that for value-help filters?

Value-help popups get generated automatically. We don't have access to the code.

davidgbarbero
Participant

Does this really work? I have tried to implement it and it doesn't do anything. I've seen your answer in other places. Can you confirm this is true? And if there is any missing code for the implementation? Thank you

FabianBerr
Explorer
0 Kudos

Hi all,

it does not work for me either.
I also tried it with customData Aggreation from SmartTable. Is there any new solution?

Best regards
Fabian

ThorstenHoefer
Active Contributor
0 Kudos

Hi,

you can use a custom Control in the filter bar and apply the filter by yourself:

How to use custom control in SmartFilterBar and perform query with value in custom control? | SAP Co...