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

Categories

0 votes
213 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...