gpt4 book ai didi

javascript - 如何禁用由 html 创建的特定 dijit contentPane 选项卡?

转载 作者:行者123 更新时间:2023-11-30 13:29:51 24 4
gpt4 key购买 nike

我正在使用 Dojo tabContainer 和 contentPane。我想要一个无法通过单击打开的选项卡。这可能吗?请帮助我。

最佳答案

显然这目前无法通过 tabContainer 实现(参见 here )来完成,但您可以尝试建议的一些操作 here

增强页面建议的解决方法是:

wildbill noticed that in _TabButton.html, there is a connection that is not set up properly. The onclick:onClick part of the outermost dojoAttachEvent should actually be onclick:_onClick

So. With that fix in place, you can disable a tab using the original piece of code above. i.e. find the tab button by iterating over the registry and filtering it out. i.e.

var b;

dijit.registry.byClass("dijit.layout._TabButton").forEach(function(x) {if (x.label=="your tab button's label") b = x;});

//now disable it...
b.setAttribute('disabled', true);

关于javascript - 如何禁用由 html 创建的特定 dijit contentPane 选项卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7144619/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com