3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class Ext.app.Portal
18 * A sample portal layout application class.
20 // TODO: Fill in the content panel -- no AccordionLayout at the moment
21 // TODO: Fix container drag/scroll support (waiting on Ext.lib.Anim)
22 // TODO: Fix Ext.Tool scope being set to the panel header
23 // TODO: Drag/drop does not cause a refresh of scroll overflow when needed
24 // TODO: Grid portlet throws errors on destroy (grid bug)
25 // TODO: Z-index issues during drag
27 Ext.define('Ext.app.Portal', {
29 extend: 'Ext.container.Viewport',
31 uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'],
37 handler: function(e, target, panelHeader, tool){
38 var portlet = panelHeader.ownerCt;
39 portlet.setLoading('Working...');
40 Ext.defer(function() {
41 portlet.setLoading(false);
47 initComponent: function(){
48 var content = '<div class="portlet-content">'+Ext.example.shortBogusMarkup+'</div>';
54 padding: '0 5 5 5' // pad the layout from the window edges
101 title: 'Grid Portlet',
102 tools: this.getTools(),
103 items: Ext.create('Ext.app.GridPortlet'),
105 'close': Ext.bind(this.onPortletClose, this)
110 tools: this.getTools(),
113 'close': Ext.bind(this.onPortletClose, this)
121 tools: this.getTools(),
122 html: '<div class="portlet-content">'+Ext.example.bogusMarkup+'</div>',
124 'close': Ext.bind(this.onPortletClose, this)
131 title: 'Stock Portlet',
132 tools: this.getTools(),
133 items: Ext.create('Ext.app.ChartPortlet'),
135 'close': Ext.bind(this.onPortletClose, this)
142 this.callParent(arguments);
145 onPortletClose: function(portlet) {
146 this.showMsg('"' + portlet.title + '" was removed');
149 showMsg: function(msg) {
150 var el = Ext.get('app-msg'),
154 el.update(msg).show();
156 Ext.defer(this.clearMsg, 3000, this, [msgId]);
159 clearMsg: function(msgId) {
160 if (msgId === this.msgId) {
161 Ext.get('app-msg').hide();