我的代码可以加载Model、View、Controller,但是启动功能不起作用。
我希望桌面上的每个图标都是一个应用程序,这样它就可以在单击每个图标时加载模型、视图、控制器。这个怎么做?
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;
},