tags:

views:

76

answers:

3

Hello friends,

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

can any one help me out thanks

A: 

with absolut zero information about code and markup, I'd just suggest you to create some kind of 'disabled' css class which makes clear for an user those tabs are disabled at present and remove all event handlers (.unbind, .kill, .undelegate)

Kind Regards

--Andy

jAndy
+2  A: 

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] } );
tvanfosson
On double click on any row in jquery grid can i enbale tab1?something like this ondblClickRow: function(rowid, iRow, iCol, e) { $("#tabs").tabs({ enabled: 1 }); var $tabs = $('#tabs').tabs(); var selected = $tabs.tabs('select', 1);but its not working?thanks
kumar
Sorry I got iti did something like this on doubleclick evnt.. $("#tabs").tabs('enable',1);thanks for yoru time
kumar
+1  A: 

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] } );
Justin Ethier