To enable a tab panel, rebind the click event for tab panel and close button, please refer to the following code:
$.extend($.fn.tabs.methods,{
disableTab: function(jq, which){
return jq.each(function(){
var tab = $(this).tabs('getTab', which).panel('options').tab;
tab.addClass('tabs-disabled').unbind('.tabs');
tab.find('a.tabs-close').unbind('.tabs');
});
},
enableTab: function(jq, which){
return jq.each(function(){
var target = this;
var panel = $(target).tabs('getTab', which);
var tab = panel.panel('options').tab;
tab.removeClass('tabs-disabled').unbind('.tabs').bind('click.tabs', {p:panel}, function(e){
var index = $(target).tabs('getTabIndex', e.data.p);
$(target).tabs('select', index);
}).bind('contextmenu.tabs', {p:panel}, function(e){
var opts = $(target).tabs('options');
var index = $(target).tabs('getTabIndex', e.data.p);
opts.onContextMenu.call(target, e, e.data.p.panel('options').title, index);
});
tab.find('a.tabs-close').unbind('.tabs').bind('click.tabs', {p:panel}, function(e){
var index = $(target).tabs('getTabIndex', e.data.p);
$(target).tabs('close', index);
return false;
});
});
}
});