Skip to main content

Search and Top Navigation

#4354 closed feature (worksforme)

Opened March 17, 2009 06:52AM UTC

Closed March 17, 2009 10:23AM UTC

Last modified October 11, 2012 09:15PM UTC

Add method for querying a tab's index position

Reported by: dmuir Owned by:
Priority: minor Milestone:
Component: ui.tabs Version: 1.7
Keywords: tabs, index Cc:
Blocked by: Blocking:
Description

There's no easy way to get the currently selected tab's index, or the index of any tab for that matter. Because of this, it's a pain to use most of the index based tab methods: add, remove, enable, select, load, url.

Adding a method for querying the position would make it a lot easier to utilise the afore mentioned methods. By allowing a jquery selector to be given as the second parameter, the interface doesn't need to become overly complex either.

Example usage:

.tabs('position'); //returns the position of the currently selected tab
.tabs('position', '.ui-tabs-selected');   //same as above
.tabs('position', '[href="#myTab"]');     //using attribute selector
.tabs('position', '#tabWithId');          //using id selector
.tabs('position', ':contains("My Tab")'); //position of tab with text "My Tab"

This functionality could be expanded to work with all index based methods and provides a means by which #3171 can be solved.:

.tabs('disable', '#tabWtihId');
.tabs('select', ':contains("My Tab")');
Attachments (0)
Change History (2)

Changed March 17, 2009 10:23AM UTC by klaus.hartl comment:1

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted