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

Change tab title dynamicly

3 Answers 1109 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Dörig Adrian
Top achievements
Rank 1
Dörig Adrian asked on 14 Feb 2012, 05:37 PM
hi

changing the tab title dynamically does not run correctly.  style is wrong...
how do i get that right?

changing the title with jquery:
$("#organizationTab").text("new tab text");

my html:
<div id="tabstrip" style="border-width:0px;">
  <ul>
      <li class="k-state-active" id="organizationTab">Tab1</li>
      <li id="businessunitTab">Tab2</li>
      <li id="userTab">Tab2</li>
  </ul>
  <div class="tabdiv">tab1</div>
  <div class="tabdiv">tab2</div>
  <div class="tabdiv">tab3</div>
</div>

regards
adrian

3 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 15 Feb 2012, 02:36 PM
Hello Dörig,

jQuery's text() method sets the text inside an element but replaces any element that may have been in it. To set the text, you will need to find the .k-link element first. Something like this should work:
$("#organizationTab").children(".k-link").text("new tab text");

All the best,
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
Daniel
Top achievements
Rank 1
answered on 24 Jul 2015, 02:31 PM

Hello, 

I want to change title but I need to set encoded : false

Thanks 

0
Alexander Popov
Telerik team
answered on 29 Jul 2015, 02:29 PM
Hello,

in that case you can use the html method instead. For example: 
tabstrip.tabGroup.find("li:eq(0) .k-link").html("<b>test</b>");

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TabStrip
Asked by
Dörig Adrian
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Daniel
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or