How can I reorder tabs in a Tabbar by dragging? The Tabbar does not seem to have any drag functionality built into it. I assume this will require creating a DragControl, but it is unclear how to go about that in this context.
After a lot of effort this is how I got it working:
Attach an onAfterRender to the tabbar. In that event set $$(“my_tabbar”).$view.childNodes[0].children to get the actual html of the tab buttons. For every tab not a “more_icon” attach a dragIn and drop DragControl. Set the html’s id to something where it will store it’s index in the tabbar’s option array. When the tab is dropped, get the index out of the source and target id, then move the tabs left/right by swapping the next and current tab’s position in the tabbar’s options. Refresh the tabbar.
It’s kind of hacky, so I am curious if anyone knows any glaring issues with this solution. I have found that if you have a dynamic tabbar and the index of the currently selected tab in the tabbar’s options is greater than the number of tabs displayed(not in the dynamic tabbar control), then there are issues. Still trying to figure that out.