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

Replace Tab HTML

3 Answers 233 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 29 Aug 2012, 11:39 AM
Hello,

Is there a way to replace Tab's HTML?  So far, the only solution I have is to remove the existing tab and then create a new tab with the updated HTML.

Best regards,

Simon

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 03 Sep 2012, 09:07 AM
Hi Simon,

You could use the contentElement method of the widget to get the tab content DOM element and jQuery.html method to replace its inner html. As an example:


Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Lee
Top achievements
Rank 1
answered on 19 Dec 2012, 04:42 PM
How would you go about adding custom icons/sprites to this example?

I have only seen examples (on web control) using DataSource and 'dataSpriteCssClass' property...And in this fashion I am unsure of how to go about getting my complex content into the DataSoruce element's 'content' property...

If possible, I'd be interested in seeing how to implement custom icons with complex (more than just a text value, some HTML) content when initializing the TabStrip from a DataSource and also, when initializing from HTML (divs)...


Thanks in advance!

- Lee
0
Atanas Korchev
Telerik team
answered on 24 Dec 2012, 11:52 AM
Hi Lee,

 You just need to include the sprite/image html in the tab:

<li><span class="k-sprite sprite-classname"></span>This is a tab with a sprite</li>
<li><img src="image_url">This is a tab with an image</li>


Here is a live demo: http://jsbin.com/ozuwub/1/edit

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