Hi, we implemented a reorderable Kendo TabStrip using jQuery UI's Sortable plugin, but are converting it to use Kendo's Reorderable widget in order to eliminate the jQuery UI dependency. This works fine for a static TabStrip, but if you add a new tab (e.g., via append()), it seems the only reasonable way to have the newly added tab be a DropTarget is to re-apply the Reorderable widget. See this JSFiddle:
As you can see, we call applyReorderable() every time a new tab is added, which seems less than ideal and potentially prone to memory leaks/inefficiencies.
I had initally wanted to simply add a new DropTarget to the new tab, analogous to what is done inside Reorderable (lines 10027-11069 of kendo.web.js, 2012.2.710). However, this would require essentially duplicating nearly the entire Reorderable class in our code (including toggleHintClass() from inside the Reorderable module closure).
So I decided to fall back on the brute-force approach of re-applying the Reorderable widget every time a tab is added. Is there a better way to do this? Will there be memory leaks doing it this way, due to event handlers and/or DOM elements not being detached, etc? I know that there are plans to add destroy() methods to all widgets, but as far as I understand, that is not ready at this time.
The approach in the JSFiddle seems to work, but is not elegant and seems potentially prone to memory issues. If you have any suggestions on how to accomplish this in a more efficient manner, it would be appreciated. Thanks!
p.s. A second question: jQuery UI's Sortable plugin will actually reorder the DOM elements upon dropping in the new location. Kendo does not actually reorder the Reorderable elements, but simply triggers an event that describes the reordering attempt (see onReorderableChange
() in my JSFiddle, where I have to reorder the .k-item tabs manually). Are there plans to have Reorderable actually reorder its elements? I realize that I will still need to reorder the content <div>s that correspond to the tabs, but it would be nice if Reorderable actually performed the reordering of its elements.