Problems creating Tabs dynamically

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    3 posts
    Member since:
    Feb 2011

    Posted 15 Jan 2014 Link to this post

    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,
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 16 Jan 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top