saulyasar
saulyasar

Reputation: 815

How to create dynamic Kendo TabStrip tabs

I have web site with side menu and Content. Inside content i have Tabstrip and i have Default one Tab.

I just want to add dynamically tabs when i select one item instead of open new view i want to show new tab inside content .

Is it possible?

Here is my Tabstrip inside Layout

 @(Html.Kendo().TabStrip()
   .Name("tabstrip-layout").SelectedIndex(0)
    .Items(tabstrip =>
     {   tabstrip.Add().Text("General").ImageUrl("~/assets/images/icons/general.svg")
         .Content(@<text>
            @RenderBody()
         </text>);
 }))

Upvotes: 1

Views: 2959

Answers (1)

saulyasar
saulyasar

Reputation: 815

I found my question answer in kendo documents. If you want to add new tabs dynaically you can use append function

https://docs.telerik.com/kendo-ui/api/javascript/ui/tabstrip/methods/append

Here is the example

$("#tabstrip-layout").kendoTabStrip();

var tabstrip = $("#tabstrip-layout").data("kendoTabStrip");
tabstrip.append({
        text: "New "tab,
        encoded: false,
        contentUrl: "../Home/Default",
        imageUrl: 'assets/images/icons/general.svg',
    });

Upvotes: 2

Related Questions