2

It'd be super useful if I could access instances of my views and controllers in my ext.js application from Chrome's console. Does anyone have a clue how to do this?


coffeescript:

window.cms = Ext.create 'Ext.app.Application',
  name: 'CMS'
  controllers: [
    'MyController'
  ...

It would seem that cms.getController('MyController') would do what I want, but I get a constructor back instead of the instance I'm looking for.

4

3 に答える 3

5

アプリケーションでアプリケーションインスタンス参照を作成する必要があります。このような:

Ext.application({
  name: 'CMS',
  controllers: ['MyController'],
  launch:function () {
     CMS.app = this;
     ...
  }
});

その後、あなたは使用することができます

CMS.app.getController('MyController')..。

于 2012-06-08T18:06:56.230 に答える
1

I don't think you get a constructor, it's just that chrome shows constructor when you call console.log on an Ext-JS object

于 2012-06-08T17:57:38.657 に答える