2 * @class Ext.app.PortalPanel
4 * A {@link Ext.Panel Panel} class used for providing drag-drop-enabled portal layouts.
6 Ext.define('Ext.app.PortalPanel', {
7 extend: 'Ext.panel.Panel',
8 alias: 'widget.portalpanel',
10 'Ext.layout.component.Body'
14 bodyCls: 'x-portal-body',
15 defaultType: 'portalcolumn',
16 componentLayout: 'body',
19 initComponent : function() {
22 // Implement a Container beforeLayout call from the layout to this Container
35 this.on('drop', this.doLayout, this);
38 // Set columnWidth, and set first and last column classes to allow exact CSS targeting.
39 beforeLayout: function() {
40 var items = this.layout.getLayoutItems(),
45 for (; i < len; i++) {
47 item.columnWidth = 1 / len;
48 item.removeCls(['x-portal-column-first', 'x-portal-column-last']);
50 items[0].addCls('x-portal-column-first');
51 items[len - 1].addCls('x-portal-column-last');
52 return this.callParent(arguments);
56 initEvents : function(){
58 this.dd = Ext.create('Ext.app.PortalDropZone', this, this.dropConfig);
62 beforeDestroy : function() {
66 Ext.app.PortalPanel.superclass.beforeDestroy.call(this);