1

我正在努力让 DeftJs 与 Sencha Cmd 一起工作。起初我怀疑 Cmd 4,但我也尝试使用 Cmd 3 得到完全相同的结果,所以我认为我只是错过了一些东西。

调用 Ext.onReady() 时出现错误“无法设置未定义的属性‘实例’”。Ext.app.Application 没有被定义,它应该是:

Ext.onReady(function() {
    // this won't be called until App has been created and its requires have been met...
    Ext.app.Application.instance = new App(); // Ext.app.Application is undefined.
});

我正在遵循https://github.com/deftjs/DeftJS/wiki/Adding-Deft-JS-to-Your-Application#using-sencha-cmd-with上的使用 Sencha Cmd(仅限 DeftJs 0.9+)的说明-deft-js-09-only

非常感谢您提供有关问题所在的任何线索。

4

1 回答 1

0

在您的Application.js文件中(在app您的项目文件夹中找到)确保包含Ext.app.Application在您的requires.

Ext.define("Phoenix.Application", {
  extend: "Deft.mvc.Application",
  requires: [
    "Deft.mixin.Controllable",
    "Deft.mixin.Injectable",
    // other required files,
    "Ext.app.Application" // <=========== HERE'S THE MISSING PIECE
  ],

  init: function() {
    this.beforeInit();
    Deft.Injector.configure(this.buildInjectorConfiguration());
    //Deft.promise.Deferred.enableLogging = false;
    return this.afterInit();
  },

  // other startup code
});
于 2014-02-24T19:53:57.880 回答