PDA

View Full Version : Custom Drag And Drop



prakaadi
19 Jan 2014, 10:35 PM
Hi,

I need to create a tab and a panel. Panel has a set of widgets , for which i am using Portlet example . The tab should have thumbnail of the widgets. So when i drag an widget from the tab , the thumbnail should expand into the widget in the portlet , and when i close the widget , it should come back in the tab as the form of thumbnail .

The problems i have is :
1) how to detect that the thumbnail is in the tab zone or the portlet zone (how to fire the event)
2) and how to convert thumbnail to widget and widget back to thumbnail when closed.

Any Help or idea's would be appreciated.
I required it by the end of tomorrow.

Regards,
K Aditya Prakash

Malte123
20 Jan 2014, 8:26 AM
Hi - I will not post a final solution - but an first Idea - this is what I need most to come into my solving track... hope this helps.

1) how to detect that the thumbnail is in the tab zone or the portlet zone (how to fire the event)


There should be several Component-Events wile drag&drop
http://docs-origin.sencha.com/extjs/4.2.1/#!/api/Ext.dd.DragDrop-method-onDragDrop

By same DDGroup you know the thumbnail is valid to the container.

So you would override this Method with your wished behavior:


2) and how to convert thumbnail to widget and widget back to thumbnail when closed.

also the other direction will work - you only have to override the Method in Class of Component.

I think the converting of thumbnails is known ?