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

后端 未结 9 956
轮回少年
轮回少年 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

    Tested sucessfully with Dojo 1.10 . Use registry instead of "dijit.byId()". The method resize() only works on the dijit.layout.BorderContainer.

    define([
        "dijit/registry" // registry
    ], function(registry) {
    
        var show = true;
    
        if (show) {
            domStyle.set(registry.byId("dijitLayoutContentPane").domNode, {'display': 'block'});
            registry.byId("dijitLayoutBorderContainer").resize();
        } else {
            domStyle.set(registry.byId("dijitLayoutContentPane").domNode, {'display': 'none'});
            registry.byId("dijitLayoutBorderContainer").resize();
        }
    
    }
    

提交回复
热议问题