This post contains the actual XML View code and the controller javascript code to construct an UI5 Responsive table with OData of type sap.m.Table and connent it to OData Service
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
controllerName="initialView.controller"
displayBlock="true">
<Page id="page1" title="Customers1" showHeader="true" enableScrolling="true"
class="sapUiContentPadding">
<Table id="Customers" headerText="Customers" items="{path: '/CustomerSet'}" >
<columns>
<Column>
<Text text="Customer ID" />
</Column>
<Column>
<Text text="Customer Name" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{Id}" />
</cells>
<cells>
<Text text="{ path:'Name' }" />
</cells>
</ColumnListItem>
</items>
</Table>
</Page>
</mvc:View>
OData Model is set on the view as shown below
onInit : function() {
var modelOData, view1;
// Odata service url must be specified below in the variable odata_url
var odata_url = 'Customer_Odata_Service';
modelOData = new sap.ui.model.odata.v2.ODataModel(odata_url, true);
view1 = this.getView();
view1.setModel(modelOData);
}