PDA

View Full Version : [CLOSED] [2.2 Bug] PortletColumns with Menu Panel do not snaps properly when draggable=true



michaeld
May 03, 2013, 5:39 AM
See the Title above to describe the issue over the one that's used by the forum.

This approach used to work in prior versions. MenuPanel (or any Panel) used instead of Portlet.

Daniil
May 03, 2013, 8:02 AM
Hi @michaeld,

Well, a Portlet is a special panel to be used in a Portal.

It is a simple class, look at the sources.

Portlet.js

Ext.define('Ext.app.Portlet', {
extend : 'Ext.panel.Panel',
alias : 'widget.portlet',
layout : 'fit',
anchor : '100%',
frame : true,
closable : true,
collapsible : true,
animCollapse : true,
draggable : {
moveOnDrag : false
},
cls : 'x-portlet',

// Override Panel's default doClose to provide a custom fade out effect
// when a portlet is removed from the portal
doClose : function () {
if (!this.closing) {
this.closing = true;
this.el.animate({
opacity : 0,
callback : function(){
var closeAction = this.closeAction;
this.closing = false;
this.fireEvent('close', this);
this[closeAction]();
if (closeAction == 'hide') {
this.el.setOpacity(1);
}
},
scope : this
});
}
}
});

You might need to apply some settings to your Panels.

Though, it would be better to use a Portlet and just put a required Panel inside.

michaeld
May 03, 2013, 8:32 AM
I tried wrapping menu-panels in Portlets with very bad results. Collapsing panels never reemerged or resized and dragging was no better off. I fear I will have to generate some samples to show how badly this upgrade to 2.0 is going. But for now I have to put this topic on hold to get other parts of the site upgraded, as dragging was not an important function for this page.

Daniil
May 03, 2013, 9:13 AM
Yes, it would be nice to have a sample to reproduce the problem.

Even if the thread is closed (it can happen in a few days), then anyway, please feel free to update it with a new post with any related information.