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

Accessing tab content

2 Answers 111 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
benjamin
Top achievements
Rank 1
benjamin asked on 16 Aug 2011, 01:45 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 16 Aug 2011, 02:17 PM
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!
0
benjamin
Top achievements
Rank 1
answered on 16 Aug 2011, 04:21 PM
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.
Tags
TabStrip
Asked by
benjamin
Top achievements
Rank 1
Answers by
Dimo
Telerik team
benjamin
Top achievements
Rank 1
Share this question
or