telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.91k forks source link

Mixing tabs with content and without content is not supported #2478

Open vladimirivanoviliev opened 7 years ago

vladimirivanoviliev commented 7 years ago

Mixing tabs with content and without content is not supported. For example having the first tab using url (redirects to another page) and second tab having content.

var tabStrip = $("#tabstrip").kendoTabStrip().data("kendoTabStrip");
tabStrip.append(
    [{
        text: "Item 1",
        url: "http://www.telerik.com"
    }, {
        text: "Item 3",
        contentUrl: "http://demos.telerik.com/kendo-ui/content/web/tabstrip/ajax/ajaxContent1.html"
    }]
);
vladimirivanoviliev commented 7 years ago

The reason for current behavior is that the content element index (of the inserted tab) is used for reordering the contentUrls collection (the tab element is not used as the sortable reorder it's position) where this index is not corresponding to actual tab index. In order to support this scenario (which seems to be never actually supported) we need to make the contentUrls collection contain reference to the actual elements in the DOM. Another option is to always render content element for each tab - even in the case the tabs have no content defined (when used as navigational component).