This post contains the actual XML View code and the controller javascript code to construct a SAP UI5 Responsive table with JSON data of type sap.m.Table and connent it to JSON Data
<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: '/'}" >
<columns>
<Column>
<Text text="Customer ID" />
</Column>
<Column>
<Text text="Customer Name" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{Id}" />
</cells>
<cells>
<Text text="{Name}" />
</cells>
</ColumnListItem>
</items>
</Table>
</Page>
</mvc:View>
Below controller code shows how the JSON Data is set on the Responsive table of type sap.m.Table
onInit : function() {
var jsonD = [
{Id : '1000', Name : 'Vikas'},
{Id : '1001', Name : 'Rao'}
];
var jsonM = new sap.ui.model.json.JSONModel(jsonD);
var table1 = this.getView().byId('Customers');
table1.setModel(jsonM);
}