How do I dynamically show and hide an entire TabContainer using DOJO?

后端 未结 9 921
轮回少年
轮回少年 2021-01-05 02:06

DOJO seems to have some quirks here. I specifically need to have the TabContainer hidden when the page loads, but then become visible after the user clicks a button. The fir

9条回答
  •  时光取名叫无心
    2021-01-05 03:09

    Old thread but I experienced this same issue and this is how I solved it. First, you cannot use display:none. Per the folks at DOJO, you have to use visibility:hidden with dijits or this will not work. So, you want this:

    Then, to show this you do the following:

    dojo.style("tabContainer", "visibility", "visible");
    

    Now, the problem this poses is what you already found out. This reserves a invisible div in your viewport that is 500px wide. So if you are using a bordercontainer, there will be this empty 500px gap in your page. To resolve this, I had to create my dijits programatically and inject them into a empty div, rather than do what you did and do it declaratively. Hope this helps someone out there.

提交回复
热议问题