At any rate, here's a quick and simple solution to disabling tabs in a tab container:
dojo.forEach(dijit.byId("myTabContainer").tablist.getChildren(), dojo.hitch(this, function(item, index, array) {
dojo.attr(item, "disabled", true);
item.onClick = function() {};
}));
Unfortunately, there doesn't seem to be a simple way to re-enable these clicks. Also, it'd be really sweet if you could simply hide some of the tabs in a tab container, but it sounds like you can only add/remove them.
HI SEAN,
ReplyDeleteThough i completely agree with your soultion and also understand that there are currently no support available for dojo release 1.3.2 for disabled tab container, but you may still have a look around this solution which proved to be handy
http://old.nabble.com/How-to-disable-a-tab-in-a-tabcontainer-td28975935.html
ReplyDeleteThanks for the heads up @dev - must take a look at that solution as an alternative.
ReplyDeleteagain, thanks for saving my day,. i created additional line to buffer the original onclick event before replace it with customized - disabled handler - which is an empty function, so we can restore it back on re enabling the tab button :
ReplyDeleteif (!tabbtn.get('buffonclick')) {
tabbtn.set('buffonclick', tabbtn.onClick);
}
p.s
tabbtn - the tab button
'buffonclick' = buffer on click