cancel
Showing results for 
Search instead for 
Did you mean: 

How To Apply Filter On JSONModel Bound To m.List

Former Member
0 Kudos

Hi All,

I have a m.list bound to JSONModel.

I have a search field wherein user types to search for items in list.

So basically, I would like to fiilter the JSONModel based on whats enetered by user in search field?

How to do this?

Please help!

Examples would really help.

Appreciate your help!

Thanks

Amjad

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor
0 Kudos

HI Amjad

Here is an example.

-D

Former Member
0 Kudos

Hey Dennis.. thanks alot..

Is it possible to have input assistance in that example.

I mean I would like to display the assistance to user.

I will then on enter press filter the list.

Appreciate your help.

former_member182862
Active Contributor
0 Kudos

HI Amjad

Can you elaborate on the input assistance that you want to have?

Thanks

-D

Former Member
0 Kudos

Hello Sean,

Basically what I want is..

User to type in the input field and he should be given assistance like (type-ahead) like you get in Google search.

Once he is done typing when he hits enter, we filter the list accordingly.

I managed to get all this done, but the assitance provided by default is startsWith but I want contains..

Hope I could explain

Former Member
0 Kudos

Take a look here :http://jsbin.com/zudazuquxa/2/edit

If you see, the filter is sap.ui.model.FilterOperator.Contains

However, it still works for only startsWith


Am I missing something?

JerryWang
Advisor
Advisor
0 Kudos

nice example

former_member182862
Active Contributor
0 Kudos

HI Amjad

You have to override the filter function provided in the input control like this.

Example

-D

Answers (1)

Answers (1)

nabheetscn
Active Contributor
0 Kudos

Hello Amjad

The sample application developed by DJ Adams has the same things implemented which you need.

please search for Learn Building Fiori like apps by DJ Adams in 10 simple exercise and use the snippet

Thanks

NAbheet