dotNet Zombie
dotNet Zombie

Reputation: 134

Enable a tab with jQuery Tabs

I disabled the tab like this:

$("#tabs").tabs({ disabled: [1, 2] });

But when I try to enable one of the tabs it is not working:

$("#tabs").tabs({ enabled: [1] });

Is there something I'm doing wrong here?

Upvotes: 3

Views: 9849

Answers (4)

Raymund
Raymund

Reputation: 7892

Shouldn't it be $("#tabs").tabs("enable", [1])?

Upvotes: 1

Jasper
Jasper

Reputation: 75993

I believe you are looking for the .tabs( "option" , optionName , [value] ) method found on this page: http://jqueryui.com/demos/tabs/ (click the "Method" tab and find "option" below).

$("#tabs").tabs( "option" , "disabled" , [2] );

Update

Under the section of the docs for $(selector).tabs('enable', n) there is this statement:

To enable more than one tab at once reset the disabled property like: $('#example').tabs("option","disabled",[]);.

Upvotes: 3

csharpnumpty
csharpnumpty

Reputation: 3723

Try $("selector").tabs("enable", n); where n is the index of the tab

Upvotes: 3

Ben
Ben

Reputation: 21249

Never used jQuery Tabs but I can't see any option for enabled.

Have you tried to just update the list of disabled tabs to remove tab 1 ?

$("#tabs").tabs({ disabled: [2] });

or

$("#tabs").tabs( "enable" , 1 ); 

(that's in the docs)

Upvotes: 3

Related Questions