使用bootstrap.js从extjs app文件夹外部加载extjs



我已经使用sencha cmd构建了extjs 5应用程序,我想在我的自定义html页面中使用它。我有以下结构:

extjsapp
    .sencha
    app
    build
    ext
    packages
    ......
    bootstrap.js
    bootstrap.json
    app.js
    .......
customapp
    index.html
    script.js

我想做的是在我的customapp/index.html我请求bootstrap.js,它应该从extjsapp文件夹加载所有包和ext。默认情况下,它会尝试从customapp/ext加载它们,这与使用bootstrap .js的地方有关。我怎样才能使它从extjsapp/ext而不是customapp/ext加载ext呢?

应该可以在任何位置使用bootstrap.js来加载extjs框架和extjs文件夹中构建的所有所需包。

app.json文件中,您将看到一个关于类路径的条目。这是用来告诉Sencha Cmd你的源文件在哪里。

同样在该文件中,您将看到一个关于indexHtmlPath的条目。这表示index.html文件的位置。

/**
 * Comma-separated string with the paths of directories or files to search. Any classes
 * declared in these locations will be available in your class "requires" or in calls
 * to "Ext.require". The "app.dir" variable below is expanded to the path where the
 * application resides (the same folder in which this file is located).
 */
"classpath": "${app.dir}/app",
...
/**
 * The file path to this application's front HTML document. This is relative
 * to this app.json file.
 */
"indexHtmlPath": "index.html",

改变ExtJS库的位置涉及编辑一个隐藏文件- .sencha/app/sencha.cfg。这里有一个属性- ext.dir -你需要改变

最新更新