Skip to Content
0
Former Member
Aug 18, 2015 at 05:59 AM

How to create smart table with out using mock server

1191 Views

Hi All,

I have created smart table using SAPUI5 Explored sample and can able to run the application.when i am trying to create same smart table with out using mock server.i am not able to create the smart table.

Can anyone help.

Code:

View.xml

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"

xmlns:smartFilterBar="sap.ui.comp.smartfilterbar" xmlns:smartTable="sap.ui.comp.smarttable"

controllerName="smarttable_northwind.main" xmlns:html="http://www.w3.org/1999/xhtml">

<Page id="page" title="SmartTable - Customer Line Items"

enableScrolling="false">

<content>

<!--

"TableList" is the EntitySet name to get the table values

-->

<smartTable:SmartTable entitySet="Categories"

tableType="Table" useExportToExcel="true"

useVariantManagement="false" useTablePersonalisation="true" header="Line Items"

showRowCount="true" persistencyKey="SmartTableAnalytical_Explored"

enableAutoBinding="true" />

</content>

</Page>

</core:View>

Controller.js

onInit: function() {

var oModel, oView;

oModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/Northwind/Northwind.svc", true);

oModel.setCountSupported(false);

oView = this.getView();

oView.setModel(oModel);

}

index.html

<script src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"

id="sap-ui-bootstrap"

data-sap-ui-libs="sap.m"

data-sap-ui-theme="sap_bluecrystal">

</script>

<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

<script>

sap.ui.localResources("smarttable_northwind");

var app = new sap.m.App({initialPage:"idmain1"});

var page = sap.ui.view({id:"idmain1", viewName:"smarttable_northwind.main", type:sap.ui.core.mvc.ViewType.XML});

app.addPage(page);

app.placeAt("content");

</script>

Do i need to change any changes to the above code??