sap.ui.jsview("zhk_ui5_empcrud.EmpDetails", { /** Specifies the Controller belonging to this View. * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller. * @memberOf zhk_ui5_empcrud.EmpDetails */ getControllerName : function() { return "zhk_ui5_empcrud.EmpDetails"; }, /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed. * Since the Controller is given to this method, its event handlers can be attached right away. * @memberOf zhk_ui5_empcrud.EmpDetails */ createContent : function(oController) { var oPage = new sap.m.Page({ title : "Employee Details", }); // Table or Dashboard to show Employee Data var oTable = new sap.m.Table({ id : "Employees", itemPress : [ oController.ItemPress,oController ], columns : [ new sap.m.Column({ width: "1em", header: new sap.m.Label({ text : "Emp ID" }) }), new sap.m.Column({ width: "1em", header: new sap.m.Label({ text : "Name" }) }), new sap.m.Column({ width: "1em", header: new sap.m.Label({ text : "Address" }) }), new sap.m.Column({ width: "1em", header: new sap.m.Label({ text : "Designation" }) }), ] }) } }); //Template to map the data to the respective column var template = new sap.m.ColumnListItem({ id: "first_template", type: "Navigation", visible: true, cells: [ new sap.m.Label("ID", { text: "{Empid}" }), new sap.m.Label({ text: "{Empname}" }), new sap.m.Label({ text: "{Empadd}" }), new sap.m.Label({ text: "{Empdes}" }) ] }); var oFilters = null; oTable.bindItems("/results",template,null,oFilters); oPage.addContent(oTable); return oPage;
Also same code is in attached document.