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

Add bootstrap badge to tab title

2 Answers 217 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
AP
Top achievements
Rank 1
Iron
Iron
Veteran
AP asked on 10 Jun 2016, 10:23 AM

Is it possible to add a bootstrap badge to a tab title?

 

I want to highlight the number of records in a tab panels, which is not initially selected.  Ideally, it would be something like:-

<span class='badge'>10</span>

Where the number would come from a variable (initially from the view bag).

 

Is this possible at all?

2 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 14 Jun 2016, 09:48 AM
Hi Andrew,

To achieve this you should set .Encoded(false) to the TabStrip item text. As an example: 
@{
    ViewBag.SomeValue = "20";
}
 
@(Html.Kendo().TabStrip()
   //....
  .Items(tabstrip => {
     tabstrip.Add().Text(("Some text <span class='badge'>") + (string)@ViewBag.SomeValue + ("</span>")).Encoded(false)
   //.....


Regards,
Iliana Nikolova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
AP
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 20 Jun 2016, 08:49 AM

That's great.

 

Thanks

Tags
TabStrip
Asked by
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Iliana Dyankova
Telerik team
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or