【问题标题】:Ext 4.2, Sencha Cmd 3 + deftjs - Can't build a working applicatonExt 4.2,Sencha Cmd 3 + deftjs - 无法构建工作应用程序
【发布时间】:2013-07-23 15:05:44
【问题描述】:

我已将用于 ext + deftjs 应用程序的构建工具从 Sencha SDK 升级到 Sencha Cmd (v3)。 为此,我还将 Ext 升级到 4.2,将 Deft 升级到 Ext 0.8。我最初遇到了 Ext.onReady() 没有被触发的问题,导致我的 viewControllers 没有从它们相应的视图中实例化。但是,我有 fixed that 并且应用程序现在正在开发模式下运行

我现在正在尝试使用命令 sencha app refreshsencha app build 构建应用程序,但构建的应用程序根本没有加载。

同样,我的 ViewController 没有被实例化。构建工具已将 deft 类和视图控制器添加到 all-classes.js。 (Deft 类首先在文件中 + 视图控制器再往下)

sencha.cfg 包含以下类路径:

app.classpath=${app.dir}/Deft,${app.dir}/ux,${app.dir}/uvd,${app.dir}/app,${app.dir}/inj.js,${app.dir}/app.js 

inj.js 包含我的加载器声明:

Ext.Loader.setConfig({
    enabled:true,
    paths:{
        'UVd': 'uvd',
        'Ext.ux' : 'ux',
        'Deft' : 'Deft',
        'FM' : 'app',
        'Ext': 'ext/src'
    }
});

Ext.syncRequire([
    "Ext.Component",
    "Ext.ComponentManager",
    "Ext.ComponentQuery",
    'Deft.mixin.Controllable',
    'Deft.mixin.Injectable',
    'Deft.Injector'
]);

我的主Viewport是第一个被实例化的视图,包含以下声明:

Ext.define('FM.view.Viewport', {
    extend: 'Ext.panel.Panel',
    requires: [
        'FM.controller.Viewport'
    ],
    // DI
    controller: 'FM.controller.Viewport'

我的开发 index.html 看起来像这样:

    <!-- <x-compile> -->
      <!-- <x-bootstrap> -->
        <script src="ext/ext-all.js"></script>
        <script src="bootstrap.js"></script>
      <!-- </x-bootstrap> -->
      <script type="text/javascript" src="inj.js"></script>
      <script src="app.js"></script>
    <!-- </x-compile> -->

有人知道为什么视图控制器不会在应用的编译版本中实例化吗?

谢谢

【问题讨论】:

    标签: extjs sencha-cmd sencha-command deftjs


    【解决方案1】:

    Ant 任务会是这样的。检查 extjs 文件夹你有这个文件夹(资源,src)

    <x-sencha-command>
                -sdk 
                    ${basedir}/WebContent/extjs
                compile
                    -classpath=WebContent/app.js,WebContent/utilities.js,WebContent/app
                    page
                        --yui
                        --in=WebContent/index.html
                        --out=WebContent/build/index.html
            </x-sencha-command>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-19
      • 2012-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多