cancel
Showing results for 
Search instead for 
Did you mean: 

apply a filter to sap.ui.table.Column / sap.ui.table.Table

Former Member
0 Kudos

Hi Team,

I'm trying to apply a filter programmatically via java script:

  press : function() {

  sap.ui.table.Column ... .setFilterValue("CH");

  sap.ui.table.Column ... .setFiltered(true);

  }

this code adds the filter "CH" to the column, but the table is not filtered/updated. Which function do I have to call?

In other words, where is the "apply" filter function? And is this function placed on the table or on the column?

Thanks and regards,

Tobi

Accepted Solutions (1)

Accepted Solutions (1)

kedarT
Active Contributor
0 Kudos

Hi Tobias,

Update the table bind with the filter. Something like this.

oTable.bindAggregation("items","/path",null,filter);

Hope this helps.

Former Member
0 Kudos

Thanks for your answer oTable.bindAggregation would mean filtering via the oData Model, but I would like to use the SAPUI5 Control instead. 


And there are no errors, the code so far is right and does what it is supposed to do, only the next step for "apply" is missing. Via the Browser, just hitting return in the filter windows is exactly what is missing via javascript:


Window:

former_member182372
Active Contributor
0 Kudos

>>oTable.bindAggregation would mean filtering via the oData Model,


NOT only Odata model, JSON should work too.


Post how do you populate data in the table.

former_member182372
Active Contributor
Former Member
0 Kudos

perfect 🙂 Thanks!

Answers (2)

Answers (2)

former_member182862
Active Contributor
0 Kudos

HI Tobias

There is an example

-D

SandipAgarwalla
Active Contributor
0 Kudos

what error do you see in the console? Does the odata triggers a filter request in the network trace?