Offset for layout

Hi,
I have layout “2E” and in the lower part I’m creating tabbar . How to let to layout or tabbar to have a small offsets in left and rights sides ? Source :

         dhtmlx.image_path = "codebase/imgs/";
         dhxLayout = new dhtmlXLayoutObject( document.body, "2E" );
         var obj   = $( "#virsus" ).get( 0 );
         dhxLayout.cells( "a" ).attachObject( obj );
         dhxLayout.cells( "a" ).setHeight( 70 );
         dhxLayout.cells( "a" ).setText( "UAB Imone'");
         dhxLayout.cells( "a" ).fixSize( false, true );
      
         var formApp = [

       ... with upper part all is OK ...

         mainTab = dhxLayout.cells("b").attachTabbar();
         mainTab.enableTabCloseButton( false );
         mainTab.addTab( "pagr_Men", kalbos_uzr( $pagr_uzr, "pagr_Men" ) );
         mainTab.setLabel( "pagr_Men", kalbos_uzr( $pagr_uzr, "pagr_Men" ), 130 );
         mainTab.enableAutoSize( true, false );
         mainTab.setTabActive( "pagr_Men" );

Thanks in advance !

Hi
You need to init layout in a dive and set this offset to it.
13.02.04layout.rar (393 KB)

Darya,

Thanks for the answer and sample . Here is piece of mine source :

<body>

   <div id='virsus' style="margin:auto; border=0; width:99%; height:8%;"></div>
   <!-- original first line    div id="pagrTabs" style="width:100%;overflow:hidden;"></div--> 
   
   <!--div id="pagrTabs" style="margin-right:15%; margin-left:15%"></div-->
   <div id="pagrTabs" style="height: 100%; margin: 25px auto; top: 0; position: relative;"></div>

   <script type="text/javascript">

      function init()
      {
         var obj1   = $( "#virsus" ).[ 0 ];  // upper part of layout
         var obj2   = $( "#pagrTabs" ).[ 0 ]; // lower part of layout

         dhtmlx.image_path = "codebase/imgs/";
         dhxLayout = new dhtmlXLayoutObject( document.body, "2E" );

         dhxLayout.cells( "a" ).attachObject( obj1 );
         dhxLayout.cells( "a" ).setHeight( 70 );
         dhxLayout.cells( "a" ).fixSize( false, true );
      
         var formApp = [
         { type: "settings", position: "label-left", offsetTop: 10 }, ...
         
         myAppForm = dhxLayout.cells('a').attachForm( formApp );       
         
         // constructing tabbar - mainTab - 

         dhxLayout.cells( "b" ).attachObject( obj2 );
         mainTab = dhxLayout.cells( "b" ).attachTabbar();
         mainTab.enableTabCloseButton( false );
         mainTab.addTab( "pagr_Men", "Main menu" );
         mainTab.enableAutoSize( true, false );
         mainTab.setTabActive( "pagr_Men" );
What I want - to do in the lower part of layout margins for tabbar - mainTab . Maybe this "enableAutoSize" don't let that ? Can't understand how to do that ...

Many thanks for help !

Could you provide an image with desirable result?

Darya,

At last I understand your sample … :smiley: . Many thanks to you ! It helped to me …

You are welcome!