EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: r2ferna on May 09, 2014, 10:24:27 AM



Title: How to know if a tab is enabled/disabled?
Post by: r2ferna on May 09, 2014, 10:24:27 AM
Hi,
In easyui-tabs class, How to know if a particular tab is enabled/disabled?

Let's say :
Code:
 
var enabled = $('#tt').tabs('isEnabled', tabIndex);
or
var disabled = $('#tt').tabs('isDisabled', 'tabTitle');

MTIA.


Title: Re: How to know if a tab is enabled/disabled?
Post by: stworthy on May 09, 2014, 09:01:25 PM
Please extend a new method to achieve this functionality.
Code:
$.extend($.fn.tabs.methods, {
isDisabled: function(jq, which){
return jq.tabs('getTab', which).panel('options').tab.hasClass('tabs-disabled');
}
})

To check if a tab panel is disabled, try this:
Code:
var disabled = $('#tt').tabs('isDisabled', tabIndex);
console.log(disabled);