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

[Solved] How to get SelectedTabIndex client-side

1 Answer 184 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin Stuparitz
Top achievements
Rank 1
Justin Stuparitz asked on 16 Feb 2010, 02:42 AM
I'm trying to get the currently selected tab index so I can dump it into a hidden field so that on post back the same tab is shown to the user.

I have a my tab strip setup for a client event:
           .ClientEvents(events => events.OnSelect("SetSelectedTabIndex")) 

And my method:
   function SetSelectedTabIndex(e) { 
       $('#SelectedTabIndex').val(e.target.tabIndex); 
   } 

The event fires successfully, but e.target.tabIndex always shows 0 even though I have 2 tabs.

thanks,
Justin


1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 16 Feb 2010, 11:05 AM
Hello Justin,

The used "e.target.tabIndex" retrieves the index of the component, which is used from the "Tab" button to focus different html tags on the page. For more information please review this link devoted on the same matter.

In order to achieve your goal you should use jQuery and search for the "li" html tag with "t-state-active" css class.

Regards,
Georgi Krustev
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
Justin Stuparitz
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or