问题描述
我正在尝试使用 SAPUI5 从 json 模型创建树结构视图。
我还没有在互联网上找到解决方案,所以这就是我在这里问的原因。
基本上,尽管一遍又一遍地使用正确的代码,它无法加载 TreeTable.js 文件,我尝试使用多个代码但没有运气。
我正在对话框上加载 TreeTable。这是代码:
<core:FragmentDeFinition
xmlns="sap.ui.table"
xmlns:mvc="sap.ui.core.mvc"
xmlns:m="sap.m"
xmlns:u="sap.ui.unified"
xmlns:core="sap.ui.core">
<m:Dialog horizontalScrolling="true" showHeader="true" state="None" stretch="false" title="{Soluzione}" type="Standard" verticalScrolling="true" contentWidth="90%">
<m:content>
<TreeTable
id="Tree"
rows="{path: 'applicationModel>/AlberoSoluzioni'}"
selectionMode="MultiToggle"
enableSelectAll="false"
ariaLabelledBy="title">
</TreeTable>
</m:content>
<customHeader/>
<endButton/>
<subHeader/>
</m:Dialog>
</core:FragmentDeFinition>
想知道我做错了什么。 加载时控制台出错:
Uncaught Error: Failed to load 'sap/ui/table/TreeTable.js' from resources/sap/ui/table/TreeTable.js: 404 - Not Found
解决方法
您需要在 dependencies
中添加它的 manifest.json
,请检查您是否这样做了。
"sap.ui5": {
"dependencies": {
"libs": {
"sap.ui.table": {}
}
}
另外,在 index.html 的引导脚本中检查 src