简体   繁体   English

Ext 4.2,Sencha Cmd 3 + deftjs-无法建立有效的应用程序

[英]Ext 4.2, Sencha Cmd 3 + deftjs - Can't build a working applicaton

I've upgraded my build tools for an ext + deftjs application from Sencha SDK to Sencha Cmd (v3). 我已经将用于ext + deftjs应用程序的构建工具从Sencha SDK升级到Sencha Cmd(v3)。 In doing so I also upgraded Ext to 4.2 and Deft to Ext 0.8. 为此,我还将Ext升级到4.2,并将Deft升级到Ext 0.8。 I initially had a problem with Ext.onReady() not being fired, resulting in my viewControllers not being instantiated from their corresponding views. 最初,我有一个问题是Ext.onReady()没有被触发,导致我的viewControllers没有从它们对应的视图中实例化。 However, I've fixed that and the application is now working in dev mode 但是,我已经修复了该问题 ,该应用程序现在可以在开发人员模式下工作

I'm now trying to build the application using the commands sencha app refresh and sencha app build but the built application isn't loading at all. 我现在正尝试使用sencha app refreshsencha app build命令构建应用sencha app refresh ,但是构建的应用程序根本无法加载。

Again, the my ViewControllers aren't being instantiated. 再次,我的ViewControllers没有被实例化。 The deft classes and the viewcontrollers have been added to all-classes.js by the build tools. 生成工具已将deft类和viewcontrollers添加到all-classes.js中。 (The Deft classes are first in the file + view controllers further down) (Deft类在文件+视图控制器中位于最下方)

sencha.cfg contains the following classpath: 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 contains my loader declarations: 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'
]);

My main Viewport is the first view to be instantiated, and contains the following declarations: 我的主视口是要实例化的第一个视图,其中包含以下声明:

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

My dev index.html looks like this: 我的开发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> -->

Does anyone have any idea why the view controllers wouldn't be instantiated in a compiled version of the app? 有谁知道为什么在应用程序的编译版本中不会实例化视图控制器?

Thanks 谢谢

Ant task will be like that . 蚂蚁的任务就是这样。 Check in the extjs folder you have this folders (resources, src) 检入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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM