cancel
Showing results for 
Search instead for 
Did you mean: 

Filter works with Mock Data but not with OData

0 Kudos

Hi,

I am searching a table based on the input from the user. I'm having trouble with filtering the oData but this works when using mock data. The mock data ends up displaying only the rows that contain the search input but the oData ends up removing all the rows completly. The metadata is the same on both.

Thanks

searchID: function(oEvt) {
	// add filter for search
	var aFilters = [];
	var sQuery = oEvt.getSource().getValue().toString().toUpperCase();
	
if (sQuery && sQuery.length > 0) { var filter = new Filter("ID", sap.ui.model.FilterOperator.Contains, sQuery); aFilters.push(filter);}
// update list binding var list = this.getView().byId("Table"); var binding = list.getBinding("items"); binding.filter(aFilters, "Application"); },

Accepted Solutions (0)

Answers (0)