How to get back newly created tabstrip DIV when creating tabs using append method?

2 posts, 0 answers
  1. Barani
    Barani avatar
    3 posts
    Member since:
    Oct 2012

    Posted 26 Oct 2012 Link to this post

    Hi,

    I am dynamically creating a tabstrip using tabstrip.append method as below,

    tabStrip.append( { text: Name, content: "test" })

    Now I want to add content to this tabstrip using the div tab dynamically.

    something like,

    $("#tabstrip-4").addContent(); --> I want to attach a jquery function which will populated the value in this div tag.

    I am not sure how to get back the DIV id of the newly created tab when using tabstrip.append function. Can someone please help?

    Thanks,
    Barani
  2. Shane
    Shane avatar
    2 posts
    Member since:
    Oct 2012

    Posted 01 Nov 2012 Link to this post

    Hi there.. 

    Something like this should to the trick.

    First find the last index (Not sure if there is a better way for this), then use the contentElement function to get the content block at that index.

    var tabstrip = $("#mainTabstrip").data("kendoTabStrip") // Get tabstip
    var lastIndex = tabstrip.tabGroup.children().length - 1; // Get last index
    var $tabContent = $(tabstrip.contentElement(lastIndex)); // Get tab content element
    $tabContent.append('<b>WOOT</b>'); // Append new html
    tabstrip.select(lastIndex); // Select tab for good measure


    -Shane


  3. Kendo UI is VS 2017 Ready
Back to Top