-
21 Jan 2013 4:45 AM #1
Answered: Web Desktop issues when navigate in windows
Answered: Web Desktop issues when navigate in windows
Hello Friends,
I have created webdesktop architecture in MVC structure. But I have problem when open more than one window and open previous opened window, I can not navigate the page after then. But newly open window is works fine.
Here is the sample code for created MVC:
app.js
And from Mydesktop view I have set the webdesktop architecture. and all window opens from it.Code:Ext.Loader.setConfig({ enabled: true, paths: { 'Ext.ux.desktop': 'lib/js' } }); Ext.application({ name: 'Mydesktop', controllers: ['Mydesktop'] });
After window open I have created new MVC for my real application
I also attached my sample code here. Please let me know if anyone knows how to handle MVC in webdesktop archtecture.Code:createWindow: function () { var desktop = this.app.getDesktop(); var win = desktop.getWindow('one-win'); if (!win) { Ext.application({ name: 'Mydesktop', appFolder: 'app', controllers: [ "layout.SampleOne" ], launch: function () { if (Ext.getCmp('one-win')) Ext.getCmp('one-win').destroy(); win = desktop.createWindow({ id: 'one-win', title: 'SampleOne', maximized: true, //modal: true, width: 740, height: 480, border: false, y: 0, autoHeight: true, resizable: true, iconCls: 'icon-grid', //animCollapse: false, //constrainHeader: true, layout: 'anchor', items: [{ layout: 'anchor', xtype: 'sampleone' }], listeners: { resize: function (t, w, h, ow, oh) { } } }); win.show(); } }); } return win; }
Thanks in advance
-
Best Answer Posted by pratik016
Resolved!
For others which may have same issue:
Just load view file using required. And in controller, when load this view load respective controller using getController.
When administration view load, then do afterrender event on parent controller and load controller of administration.Code:win = desktop.createWindow({ id : 'admin-win', title : 'Administration'.l('SC30000'), maximized : true, width : 740, height : 480, border : false, y : 0, autoHeight : true, resizable : true, iconCls : 'icon-administration', layout : 'fit', items : [{ layout : 'fit', xtype: 'administration' } ]});
Its work for me, hope for others as well. Let me know if any difficulty on it.Code:this.control({ administration : { afterrender : function (e, n, r, i) { var s = t.getController("layout.Administration"); s.init(); } } })
-
10 Mar 2013 11:59 PM #2
Resolved!
For others which may have same issue:
Just load view file using required. And in controller, when load this view load respective controller using getController.
When administration view load, then do afterrender event on parent controller and load controller of administration.Code:win = desktop.createWindow({ id : 'admin-win', title : 'Administration'.l('SC30000'), maximized : true, width : 740, height : 480, border : false, y : 0, autoHeight : true, resizable : true, iconCls : 'icon-administration', layout : 'fit', items : [{ layout : 'fit', xtype: 'administration' } ]});
Its work for me, hope for others as well. Let me know if any difficulty on it.Code:this.control({ administration : { afterrender : function (e, n, r, i) { var s = t.getController("layout.Administration"); s.init(); } } })


Reply With Quote