Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to use filter in ui5 table

Hi,

I am  trying to use filter but after clicking in button event all the data are coming. It is not filtering any  data..

var oModel = this.getView().getModel();

  var oIn1 = this.getView().byId("in1").getValue(); 

   var oTable = this.getView().byId("Tab2");

      oTable.addColumn(new sap.ui.table.Column({

           label : new sap.m.Label({ text : "MaterialNo"}),

           template : new sap.m.Text({ text : "{MaterialNo}", filterProperty:aFilter  }),

           }

       ));

       oTable.addColumn(new sap.ui.table.Column({

           label : new sap.m.Label({ text : "SalesOrderNo" }),

           template : new sap.m.Text({ text : "{SalesOrderNo}", filterProperty:aFilter }),

           }

       ));

       oTable.getBinding("rows").filter([aFilter]);

       //Filter values for a certain Sales Number

       var aFilter=new sap.ui.model.Filter( "SalesOrderNo", sap.ui.model.FilterOperator.Contains, oIn1) ;

      

       oTable.bindRows({ path: "/MaterialNode", filters: [aFilter], });

  }

Thanks..

Not what you were looking for? View more on this topic or Ask a question