1

私のコードはモデル、ビュー、コントローラーをロードできますが、起動機能は機能しません。

デスクトップ上のすべてのアイコンをアプリにして、それぞれがクリックされたときにモデル、ビュー、コントローラーをロードできるようにします。これを行う方法?

Ext.define('MyApp.GridWindow', {
    extend: 'Ext.ux.desktop.Module',

    requires: [
        'Ext.data.ArrayStore',
        'Ext.util.Format',
        'Ext.grid.Panel',
        'Ext.grid.RowNumberer'
    ],

    id:'grid-win',

    init : function(){
        this.launcher = {
            text: 'Grid Window',
            iconCls:'icon-grid',
            handler : this.createWindow,
            scope: this
        };
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('grid-win');

        if(!win){

          Ext.application({
              name: 'USER',
              appFolder: PUB+'/extjs4/mUser',
              controllers: [
                  "User"
              ],
              launch: function () {
                  win = desktop.createWindow({
                      id: 'notepad',
                      title:'Notepad',
                      width:600,
                      height:400,
                      iconCls: 'notepad',
                      animCollapse:false,
                      border: false,
                      hideMode: 'offsets',
                      layout: 'fit',
                      items: [{
                          xtype: 'htmleditor',
                          //xtype: 'textarea',
                          id: 'notepad-editor'
                       }]
                   });
               }
        });

        win.show();
        return win;
},
4

1 に答える 1

0

(1) Controller セクションで onLaunch 関数を試すか、(2) のように app.js の最後で関数を起動します。

(1)

onLaunch:function()
        {}

(2)

launch:function(){
//runs when controllers init function is completed
}
于 2013-06-20T11:21:54.517 に答える