EasyUI Forum
December 21, 2025, 11:11:37 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: disabling tab user click  (Read 12391 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: June 26, 2014, 04:44:03 PM »

I am selecting the tabs from another object and need to disable the tab click event so that the user can not change tabs by clicking on them, but the other object that controls the tabs can still work.

I have tried to unbind the tab's click even but that does not work:

Code:
$('.tabs-inner').unbind();

How can I disable the click event whilst still allowing the tabs to be selected programatically ?
Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2305


View Profile Email
« Reply #1 on: June 26, 2014, 06:39:46 PM »

Please call 'disableTab' method to disable a special tab panel. When a tab panel is disabled, users can not click to select it but this tab panel still can be selected by calling 'select' method.
Code:
var t = $('#tt');  // the tabs object
t.tabs('disableTab', index);  // disable the special tab panel
t.tabs('select', index);  // select this tab panel again
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: June 26, 2014, 06:42:15 PM »

Thanks, but I have already tried that, the tab get greyed out, I will want it to appear to look normal and not look like it is disabled.

How can I unbind the click event from the tab, as this will solve the problem without having to hack the CSS.
Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2305


View Profile Email
« Reply #3 on: June 26, 2014, 06:50:29 PM »

Please add the style below to the page to prevent from greying the tab title.
Code:
<style>
.tabs-disabled{
  opacity:1.0;
}
</style>
If you do not want the user to select all the tabs, you can hide the tabs header.
Code:
$('#tt').tabs({
  showHeader:false
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!