【发布时间】:2015-06-29 08:36:42
【问题描述】:
我想在sapui5 explored sample 中使用智能表,但问题是我有一个 OData 模型,该示例仅显示了我们如何处理与模拟数据的绑定,而且我不了解 metadata.xml 文件.我猜 oData 模型也有自己的元数据文档。这是我在控制器中的代码:
this.DataPath = "QuarterPerformanceSet";
var oModel = new sap.ui.model.odata.ODataModel(model.Config.getServiceUrl(), true, model.user, password);
oModel.setCountSupported(false);
oSmartTable.setModel(oModel);
oSmartTable.setEntitySet(this.DataPath);
但它不起作用。我收到了这个错误:
无法从 ./Component-changes.json 加载 Component-changes.json。检查“找不到文件”或解析错误。原因:未找到 -
getChanges' 失败:-
如何使用我的 odata 模型设置 entitySet?
我的看法:
<smartTable:SmartTable id="idSmartTable" tableType="Table"
useExportToExcel="true" useVariantManagement="false"
useTablePersonalisation="true" header="Line Items" showRowCount="true"
persistencyKey="SmartTableAnalytical_Explored" enableAutoBinding="true"/>
如果有人可以提供帮助,请提前感谢您。
更新2:我根据discussion重新绑定表
this.DataPath = "QuarterPerformanceSet";
var oModel = new sap.ui.model.odata.ODataModel(model.Config.getServiceUrl(), true, model.user, password);
oModel.setCountSupported(false);
var oSmartTable = this.getView().byId("idSmartTable");
oSmartTable.setModel(oModel);
oSmartTable.setEntitySet(this.DataPath);
oSmartTable.rebindTable();
很遗憾,但我仍然遇到同样的错误。
【问题讨论】:
标签: javascript odata sapui5