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

Obtaining RabStrip object from OnClientSelected

1 Answer 71 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Richard Boarman
Top achievements
Rank 1
Richard Boarman asked on 10 Sep 2010, 03:19 PM

I have a page where a radgrid holds a nested view template that expands and displays a RadTabStrip. Therefore, if more than one row is expanded, then more than one RadTabStrip is on the page at one time.

When a tab is selected, I perform some client side actions.

On PreRender, this function is called:

Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Dim txt As String = MatchesTabStrip1.SelectedTab.Text
....ExecuteClientScript(
"resetFunctionLinks('" & MatchesTabStrip1.ClientID & "','" & txt & "')")
End Sub

This is the client side function that passes in the tabStrip object into another function:

function resetFunctionLinks(myTab,txt) {
if (myTab) {
configureFunctionLinks(myTab,txt);
}}


When a tab is selected, I want to pass the tab strip into the same function as above (configureFunctionLinks():

function OnClientTabSelected(sender, eventArgs) {
var tab = eventArgs.get_tab();
var txt = tab.get_text();
var tabStrip = tab.get_tabStrip();
configureFunctionLinks(tabStrip, txt);
}

This (var tabStrip = tab.get_tabStrip();) is not correctly obtaining the RadTadStrip object and passing it into the function in the same manner that the “resetFunctionLinks” is handling it.

What am I missing?

 

 

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 15 Sep 2010, 12:07 PM
Hi Richard,

The first parameter of the OnClientTabSelecting event handler is the instance of the RadTabStrip object.
You may use directly the "sender" instead of:

var tab = eventArgs.get_tab();
var tabStrip = tab.get_tabStrip();


Regards,
Helen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Richard Boarman
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or