Skip to Content
Jan 24, 2021 at 07:28 AM

How to apply filter before rendering



i'm trying to apply a filter after clicking on a sap.m.Table row.

I click on the row and save a variable of that row in a global attribute.

Then i navigate to another view, that view has another sap.m.Table which i want to filter with the variable i just saved.

Here is my method:

onBeforeRendering: function () {'---------------------------');$.masterID);'---------------------------');
			var aTableSearchState = [];
			var sQuery = $.masterID;
			if (sQuery && sQuery.length > 0) {
				aTableSearchState = [new Filter("master_id", FilterOperator.Contains, sQuery)];
			var oTable = this.byId("table");
			oTable.getBinding("items").filter(aTableSearchState, "Application");

Its giving me the right variable in $.masterID but the filter doesn't work at all

Thanks in advance for any reply!