This is a migrated thread and some comments may be shown as answers.

Problems creating Tabs dynamically

1 Answer 258 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 15 Jan 2014, 04:59 PM
Hi,

I need to create 3 tabs dynamically (with JavaScript), It works fine, if I have another tab created before, if not, I can see the "tab titles" but not the content and I am don't know what happens.

If I have this:

<div id="tabstrip" >
<ul>
       <li class="k-state-active">tab 1</li>
</ul>
 <div>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
    </div>
</div>

I can create new Tabs using this function:

var tabStrip = $("#tabstrip").kendoTabStrip().data("kendoTabStrip");
tabStrip.append({
            text: "title",
            content:  generateTabContent("19")
        });

And works fine, but I have problems when I try to create new tabs dynamically without any previous tabs... 

I am sure that is something simple... but I cannot find the problem.

Please can anyone help me? 
Thanks,

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 16 Jan 2014, 09:22 AM
Hi Andrew,

I would recommend checking this example, which demonstrates how to add tabs to an empty TabStrip widget.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip
Asked by
Andrew
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or