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

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

1 Answer 104 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Barani
Top achievements
Rank 1
Barani asked on 26 Oct 2012, 06:06 PM
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

1 Answer, 1 is accepted

Sort by
0
Shane
Top achievements
Rank 1
answered on 02 Nov 2012, 02:03 AM
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


Tags
TabStrip
Asked by
Barani
Top achievements
Rank 1
Answers by
Shane
Top achievements
Rank 1
Share this question
or