Accessing tab content

3 posts, 1 answers
  1. benjamin
    benjamin avatar
    7 posts
    Member since:
    Aug 2011

    Posted 16 Aug 2011 Link to this post

    Hi,

    i would like to change the content of one tab without using ajax.
    For that thing i need to access the content of one tab. Is it possible ?

    ex:
     <div id="tabstrip">
         
    <ul>
             
    <li>First Tab</li>
             
    <li>Some Html code that may change dynamically, but without ajax call or local source binding</li>
         
    </ul>
         
    <div id="first-content">First Tab Content</div>
         
    <div id="second-content">Second Tab Content</div>
     
    </div>

    Before using Kendo, i was able to access to content tab using $('#first-content')
    But now, with Kendo, the id always change. So is there a suimple way to access it or must i code a
    function to do that ?

    Thanks
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8483 posts

    Posted 16 Aug 2011 Link to this post

    Hi Benjamin,

    The IDs of the TabStrip content wrappers are based on the TabStrip ID with a hyphen and an index number as a suffix, e.g.

    tabstripID-1
    tabstripID-2

    By knowing the index of the wrapper, which you want to access, you can modify its content.

    Alternatively, you can use unique custom CSS classes for the content wrapper divs, which (unlike custom IDs) are preserved during the widget initialization, so you can use them in jQuery selectors.


    All the best,
    Dimo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. benjamin
    benjamin avatar
    7 posts
    Member since:
    Aug 2011

    Posted 16 Aug 2011 Link to this post

    Ok
    i used contentElements property in my test. Maybe it's not the right way but it works. i may change to your solution.

    Thanks.
Back to Top