Skip to Content
author's profile photo Former Member
Former Member

Table Row Filter

Is it possible to have a filter that excludes rows from a table if one of its characteristics is set.

Basically just want to exclude items in a list that have a inactive flag set in the model

could be like:

bus_no:1

bus_desc: express

inactive: Y

so that row above is excluded from the table but still in the model

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 16, 2014 at 01:19 PM

    yes it is possible. Apply filter in bindrows and filter condition should be like this sap.ui.model.FilterOperator.NE.

    For more info check api

    JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.FilterOperator

    var aFilter = [];
    aFilter.push( new sap.ui.model.Filter("firstName", sap.ui.model.FilterOperator.NE, "Donald") );
    aFilter.push( new sap.ui.model.Filter("lastName", sap.ui.model.FilterOperator.NE, "Luke") );
      
    oTable.bindRows({
    path: '/clients',
    filters: aFilter
    });
    

    Check working example here JS Bin - Collaborative JavaScript Debugging</title> <link rel="alternate" type="application/jso…

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 16, 2014 at 02:13 PM

    Hello Bob,

    Here's a sample which uses your example, an XML view, and applies the filter on an event.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.