Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable the tabs using jquery

Tags:

jquery

I have three subtabs under main tab, when I click main tab defauly I am displyaing tab1 data using jquery grid, now initially I need disable the tab2 and tab3. how?

like image 716
kumar Avatar asked Apr 13 '10 13:04

kumar


2 Answers

From the jQuery UI tabs documentation. Note that it's zero-based so this disables the 2nd and 3rd tabs.

$( ".selector" ).tabs( { disabled: [1, 2] } );
like image 125
tvanfosson Avatar answered Nov 05 '22 04:11

tvanfosson


Assuming you are using the jQuery UI tabs:

You can use "disable" to disable a given tab after initialization:

jQuery("#myTab").tabs( "disable" , index )

Alternatively, if you need to disable tabs when the tabs are first displayed, you can pass the disabled option and an array of tabs to disable:

$( ".selector" ).tabs( { disabled: [1, 2] } );
like image 30
Justin Ethier Avatar answered Nov 05 '22 05:11

Justin Ethier