sap.ui.define([ "sap/ui/core/mvc/Controller", "sap/ui/model/Filter", "sap/ui/model/FilterOperator"], /** * @param {typeof sap.ui.core.mvc.Controller} Controller */ function (Controller, Filter, FilterOperator) { "use strict";
return Controller.extend("emprej.controller.View3", { onInit: function () { this.oTable = this.byId("table0"); this.oDataModel = this.getOwnerComponent().getModel(); this.getView().setModel(this.oDataModel); // Fetch the data for employees from India this.showEmployeesFromIndia(); }, showEmployeesFromIndia: function () { var oFilter = new Filter("country/name", "eq", "India"); this.oTable.bindItems({ path: "/Employees", filters: [oFilter], template: new sap.m.ColumnListItem({ cells: [ new sap.m.Text({ text: "{ID}" }), new sap.m.Text({ text: "{fname}" }), new sap.m.Text({ text: "{lname}" }), new sap.m.Text({ text: "{desig}" }), new sap.m.Text({ text: "{skills}" }), new sap.m.Text({ text: "{country}" }), new sap.m.Text({ text: "{State}" }), new sap.m.Text({ text: "{city}" }), new sap.m.Text({ text: "{doj}" }), new sap.m.Text({ text: "{yoe} year" }), new sap.m.Text({ text: "{gender}" }), ], }), }); }, }); });
I have a capm cds entity employee and every employee is associated with a country in my ui5 homepage i have 3 tile
India Netherlands and singapore where in user clicked on india should only return employee from india
i have this odata url https://port42909-workspaces-ws-gqv5d.us10.trial.applicationstudio.cloud.sap/Aarini/Employees?$filter=country/name eq 'India' where it only return me employee in india same i want to do in my ui5 i have created a table where it shows all the employees also i m using this approach to make it possible