Change tab title dynamicly

4 posts, 0 answers
  1. Dörig Adrian
    Dörig Adrian avatar
    3 posts
    Member since:
    Sep 2002

    Posted 14 Feb 2012 Link to this post

    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
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 15 Feb 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Daniel
    Daniel avatar
    1 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2015 Link to this post

    Hello, 

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

    Thanks 

  5. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 29 Jul 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready