Ext.ux.panel.DDTabPanel

Ext.ux.panel.DDTabPanel

Ext.ux.panel.DDTabPanel extends Ext.TabPanel to support drag and drop operations to re-order the tabs.

This extension is the result of the work done in the topic "Draggable Panel in a TabPanel". When I started using the code in that thread, I found that clicking a tab to activate it didn't work any longer, you had to start dragging for it to activate. After some investigation, this was fixed by adding an onMouseDown event to activate the tab. As suggested by mabello, I decided to publish this great piece of work by giving it its own topic and by publishing it on the UX Repository.

This extension is based on the code of thommy and rizjoj and was then fixed, polished and published by myself.

Okay, it's in the repository now. Some small adjustments to the documentation have been done which will be reflected in the repository in approximately an hour (the interval between two repository updates).

This thread is open for suggestions, questions, bug reports and appreciations!

Known bugs:

None, yay!

Limitations:

The tab panel can't be made stateful.
It'd be very hard to do this as the default tab panel itself doesn't seem to support this either. Seen from a developer's point, it would be very hard too as some tabs are loaded dynamically through AJAX requests and such, how would one save those in a cookie?

To-do's:

Allow tabs to be dropped on another tab panel by joining the drag and drop sources and targets.

Very good remark.
It seems like this doesn't work properly. I also found that multiple DDTabPanels seem to interfere with each other when dragging a tab. Further investigation will follow in how to solve these problems.

An update has been sent to the SVN (version 1.0.2) which should fix the conflict between multiple DDTabPanels. This was caused by the class using the same drop target identifier for all panels and the helper class selecting the wrong drop header. Well, that's what you get when you try to get the most out of a quickly written extension I guess. Maintaining this thing sounds a lot more creepy now... :P But I can handle it.

Originally Posted by mystix

+10. great job.

p.s. a draggable option on each "tab" would be good.

Thank you.
That is a great idea indeed, I'll certainly have a look at it tomorrow.

There is, unfortunately, a problem with tabs dragging when 'west' region is set. Something is wrong with calculating X offset where to put a dragged tab. Please try adding this to the first window items in the demo file and try it yourself:

PHP Code:

{region: 'west',width: 200,html: 'test'},

Moreover, I have the issue with drag "tip" rendering when tab has an icon set by iconCls property (see attached screenshot).