I have a tabstrip which loads a page from URLContent.
I'd like to accomplish the following:
- If a tab with the targetted URL is already open, instead of appending a new tab, select the existing tab.
- If it's a new tab, append the tab dynamically and load it.
From the documentation, there seems to be no default way of handling this.
http://docs.kendoui.com/api/web/tabstrip
Also, I'd like to know if there are any ways to dynamically retrieve the ID/Name of the tab given it's tab index.
Here's how I'm initializing the Tabstrip:
<div class="mainContentTabStrip" style="width:100%;height:100%">
<kendo:tabStrip name="mainVerticalTabStrip">
<kendo:tabStrip-animation>
<kendo:tabStrip-animation-open effects="fadeIn" />
</kendo:tabStrip-animation>
</kendo:tabStrip>
</div>
And then to append a new tab:
function mainContentTreeView_onSelect(e)
{
var dataItem = $("#mainVerticalMenu").data("kendoTreeView").dataItem(e.node);
var selectedNodeText = dataItem.text;
var selectedNodeValue = dataItem.id;
var mainVerticalTabStrip = $("#mainVerticalTabStrip").data("kendoTabStrip");
mainVerticalTabStrip.append({
text: selectedNodeText +
" <img src='image/image/button_cancel.png' " +
"id='" + this.text(e.node) + "' " +
"name='" + this.text(e.node) + "' " +
"onclick='javascript:mainContentTreeView_delete()' " +
"onmouseover=" + this.text(e.node) + ".src='image/image/button_cancel_over.png' " +
"onmouseout=" + this.text(e.node) + ".src='image/image/button_cancel.png' " +
">",
encoded: false,
contentUrl: "screen/" + selectedNodeValue,
selected: true
});
}