Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

javascript - Failed to load 'sap/ui/table/TreeTable.js'

I'm trying to create a tree structure view from a json model using SAPUI5.
I haven't found solutions on the internet so this is why I'm asking here.
Basically, despite having used the right code over and over again, It fails to load the TreeTable.js file, I have tried using multiple codes but no luck.
I am loading the TreeTable on a Dialog. This is the code:

<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>

Wondering what I'm doing wrong. Error in console at loading:

Uncaught Error: failed to load 'sap/ui/table/TreeTable.js' from resources/sap/ui/table/TreeTable.js: 404 - Not Found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to add its dependencies in the manifest.json please check if you did so.

"sap.ui5": {
        "dependencies": {
            "libs": {
                "sap.ui.table": {}
            }
        }

Also, check src in the bootstrap script in index.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...