Tabbar attachform resize problem

Hi

I have a tabbar with forms attached using the tabbar.cells(‘n’)attachform() function, and I want to resize each tab to the size of the form it contains, as the [url]http://www.dhtmlx.com/docs/products/dhtmlxTabbar/samples/06_behaviors/02_size_by_content.html[/url] example.

The problem is that each tab keeps the same height of the div containing the tabbar.

I used every example I’ve found in the forum with no success.

the div containg the tabbar is defined as:

and then script is called from :

    function initPage(){
        var forms = [];
        var tabbar = new dhtmlXTabBar('wrapper', 'top');

        tabbar.addTab("forma", "Datos Generales", "100px");
        tabbar.addTab("formb", "Instrucciones", "100px");

        forms['forma'] = tabbar.cells('forma').attachForm(form1);
        forms['formb'] = tabbar.cells('formb').attachForm(form3);

        tabbar.enableAutoReSize();
        tabbar.enableAutoSize(false, true);
        tabbar.normalize(800,true);
        tabbar.cells("forma").autoSize();
        tabbar.cells("formb").autoSize();

        tabbar.setTabActive('forma',true);
    }

What I’m doing wrong? :cry: or what I’m trying to do is only available in the pro version? I’m using version 3.6.

best regards.

Hi
To achieve it you need this you need to create forms in separated divs and attach these divs to tabs.
Like here:

tabbar = new dhtmlXTabBar("a_tabbar", "top"); tabbar.setImagePath("../dhtmlxTabbar/codebase/imgs/"); tabbar.setSkin('dhx_skyblue'); tabbar.enableTabCloseButton(true); tabbar.enableAutoSize(false, true); tabbar.addTab("tab1","1111111","180px"); tabbar.addTab("tab2","2222222","180px"); tabbar.addTab("tab3","3333333","180px"); form1 = new dhtmlXForm("myForm1"); form2 = new dhtmlXForm("myForm2"); form1.loadStruct("../___xml/form.xml"); form2.loadStruct("../___xml/dhxform.xml"); tabbar.cells("tab1").attachObject(myForm1); tabbar.cells("tab2").attachObject(myForm2); tabbar.setTabActive("tab1");

Hi Darya

It worked perfectly. :smiley:

Thanks

You are welcome!