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

Get tabstrip object in javascript.

1 Answer 80 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
vn
Top achievements
Rank 1
vn asked on 18 Aug 2008, 05:54 PM
Hi,

How do I get the tabstrip object in Javascript?  I have a tabstrip on my usercontrol and I used $find function to find the object but it always return null.

Here's my code:

<

telerik:RadTabStrip ID="testTS" runat="server" Skin="Office2007">
<Tabs>
<telerik:RadTab runat="server" ID="tab1" Text="tab 1" />
</Tabs>
</
telerik:RadTabStrip>

...

var

testTS = $find( "<%=testTS.ClientID %>" );

Thank you.



1 Answer, 1 is accepted

Sort by
0
vn
Top achievements
Rank 1
answered on 19 Aug 2008, 12:17 AM
I found the problem.  I used ScriptManager.RegisterStartupScript() method to call the javascript function that contain the $find() function.  I think the call happened too soon and the tabstrip javascript object is not yet loaded/created.  This used to work in the older Telerik 2007 but not 2008.  I resolved the problem by registering the javascript function that I want to call with the Sys.Application.Load event.

Sys.Application.add_load( JavascriptFunctionToCall );

The JavascriptFunctionToCall javascript function, which calls the $find() function, will be called after all javascript object is loaded.

Vincent

Tags
TabStrip
Asked by
vn
Top achievements
Rank 1
Answers by
vn
Top achievements
Rank 1
Share this question
or