0

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
    });
}
TtT23
  • 6,876
  • 34
  • 103
  • 174
  • You can do it but you need to do it programmatically. How do you initialize the tabstrip using a DataSource or HTML `
  • `?
  • – OnaBai Mar 26 '13 at 08:02
  • @OnaBai DataSource, from JSON string. – TtT23 Mar 26 '13 at 08:05
  • Would be possible to show it in the question or in a JSFiddle? – OnaBai Mar 26 '13 at 08:12
  • @OnaBai Actually, I was using the JSP wrapper ver to initialize it. I have edited the OP. – TtT23 Mar 26 '13 at 08:51