PDA

View Full Version : Changing panel position with drag and drop



Androrion
22 Feb 2008, 6:38 AM
Hi,

On one of my pages, I've got four different panels. I'd like to switch their position dynamically with a drag and drop. For exemple if I drag panel 1 between panels 3 and 4 and if I drop panel 1, i'd like to reorganize the panel positions this way :

Panel 2
Panel 3
Panel 1
Panel 4

Is there an object or a panel function to do that? Or do i have to write some code? I took a look at the DD object but i don't really figure out how to achieve this.

Thanks for your help :)

22 Feb 2008, 9:32 AM
Look at the portal example.

extnewuser
22 Feb 2008, 2:34 PM
I am looking for the same thing....if you have any luck in saving the position please share it...i will do the same.

Thanks in advance

Androrion
6 Mar 2008, 6:12 AM
I've seen the portal exemple and the drag and drop effect is exactly the one i'd like to have. Unfortunately, i don't really understand how it works... I tried to use it, simply by including the different js in my page (Portlet, Portal and PortalColumn) and using the following code :


Ext.onReady(function(){
var tools = [{
id:'gear',
handler: function(){
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
}
},{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}];
var monDDtest = new Ext.Panel({
renderTo:'myTest',
xtype:'portal',
items:[{
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Grid in a Portlet',
tools: tools,
html:'jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj'
},{
title: 'Another Panel 1',
tools: tools,
html: 'ploplpoplpoplpoplpoplpoplpo'
}]
}]
});
});


I get no error in firebug but the panels are not draggable at all :(