Tabbar in Window

When using following code

[code]

ComposerUI
<link rel="stylesheet" href="/resources/dhtmlx/codebase/dhtmlx.css">
<script type="application/javascript" src="/resources/dhtmlx/codebase/dhtmlx.js"></script>
<script type="text/javascript">
    var dlg;

    function getDialog(){
        if (!dlg){
            wins = new dhtmlXWindows();
            dlg = wins.createWindow('test',100,100,300,400);
            dlg.button('close').show();
            dlg.attachEvent('onClose', function(){
                dlg.hide();
                return false;
            });
            dlg.tabBar = dlg.attachTabbar({
                tabs:[
                    {id:'tab1',text:'Tab1',html:'Tab1'},
                    {id:'tab2',text:'Tab2'}
                ]
            });
            dlg.tabBar.tabs('tab1').attachHTMLString('<h1>Tab1</h1>');
            dlg.tabBar.tabs('tab2').attachHTMLString('<h1>Tab2</h1>');
        }
        return dlg;
    }
    dhtmlxEvent(window, 'load',function(){
        var tb = new dhtmlXToolbarObject(document.body);
        tb.addButton('btnTab1',0,'tab1');
        tb.addButton('btnTab2',1,'tab2');
        tb.attachEvent('onClick', function(button){
            var dlg = getDialog();
            switch(button){
                case 'btnTab1': dlg.tabBar.tabs('tab1').setActive(); break;
                case 'btnTab2': dlg.tabBar.tabs('tab2').setActive(); break;
            }
            dlg.show();
            //dlg.tabBar.setSizes();
        })

    });
</script>
<style type="text/css">
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        overflow: hidden;
        border:0;
        padding:0;
    }
</style>
[/code]

When clicking button tab1, window is shown with tabs. Then close window (it is just hidden) and click button tab2 and tabbar is not visible in window.

Uncomment line //dlg.tabBar.setSizes(); and it will work.

kasi

Hello
We manage to reproduce the issue. We will inspect it

Hi

that because tabbar operate with tabs inside hidden window. it try to get offsetWidth but due element is hudden, it got zero-size. you need to show window first and then activate tab.