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

Adding tab by JS, put HTML in title

3 Answers 168 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 20 Jan 2012, 09:39 AM
Hello,

Simple question : when i add a tab by javascript, is it possible to put HTML instead of simple text for the tab's title ?
I want to ad a close button in fact.

Regards,
Guillaume

3 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 24 Jan 2012, 09:08 AM
Hi Guillaume,

Yes, you can, but you need to specify encoded: false as an option. Something like this:
tabStrip.append({
    text: "<b>Item 1</b>",
    encoded: false
});


Regards,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Leonel
Top achievements
Rank 1
answered on 18 Feb 2012, 05:22 PM
Kamen Bundevexcellent, but now when I send the tab to remove the image that aggregates will not let me without first select the tab. it is possible to know which index the close button that I clicked? 
0
Kamen Bundev
Telerik team
answered on 20 Feb 2012, 12:44 PM
Hello Leonel,

If you attach a handler to the close button onclick event, you can use the event to get the event target and from there find the closest item (a LI element in the Kendo TabStrip). Then you can use the item to pass it to the TabStrip remove() method.

Kind regards,
Kamen Bundev
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
Guillaume
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Leonel
Top achievements
Rank 1
Share this question
or