on 01-12-2015 10:39 AM
Hi Experts,
I want to know how to filter data more than 2 values..i can able to filter single property data..but i want to search all fields data.
I used below code:
search: function(oEvent)
var SamTbl = oEvent.getParameter("newValue");
var filters = new Array();
var oFilter = new sap.ui.model.Filter("Name", sap.ui.model.FilterOperator.Contains, SamTbl);
// var oFilter1 = new sap.ui.model.Filter("Age", sap.ui.model.FilterOperator.Contains, SamTbl);
filters = (oFilter);
var listItem = sap.ui.getCore().byId("oTable");
var binding = listItem.getBinding("items");
binding.filter(filters);
can you please say here where i can make change to filter all fields data.
Thanks & Regards,
Palsaran
Hi Pal
You're very close. Code should be
var contains = sap.ui.model.FilterOperator.Contains;
var filters = new sap.ui.model.Filter([
new sap.ui.model.Filter("Name", contains, SamTbl),
new sap.ui.model.Filter("Age", contains, SamTbl)],
false); // false for OR
OR
var contains = sap.ui.model.FilterOperator.Contains;
var columns = ['Name', 'Age', "Column1', ColumnX', ColumnY'];
var filters = new sap.ui.model.Filter(columns.map(function(colName) {
return new sap.ui.model.Filter(colName, contains, SamTbl); }),
false);
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please anyone address this..
Thanks,
Palsaran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
maybe use google search?
I used those Keywords: sapui5 filter multi fields
First result refers to following discussion with good example code:
filtering - How to filter a table on multiple columns in SAPUI5 - Stack Overflow
Sometimes nobody want to answer, because its already discussed.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.