简体   繁体   中英

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). In doing so I also upgraded Ext to 4.2 and Deft to 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. 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.

Again, the my ViewControllers aren't being instantiated. The deft classes and the viewcontrollers have been added to all-classes.js by the build tools. (The Deft classes are first in the file + view controllers further down)

sencha.cfg contains the following classpath:

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:

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:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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