Extjs-layout-hbox

提供:Dev Guides
移動先:案内検索

Ext.js-hboxレイアウト

説明

hbox:このレイアウトでは、要素を水平方向に分散できます。

構文

hboxレイアウトを使用する簡単な構文を次に示します

 layout: 'hbox'

以下は、hboxレイアウトの使用法を示す簡単な例です

<!DOCTYPE html>
<html>
<head>
   <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet"/>
   <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
   <script type="text/javascript">
      Ext.onReady(function() {
         Ext.create('Ext.panel.Panel', {
            renderTo : Ext.getBody(),
            layout : {
               type :'hbox'
            },
            requires: ['Ext.layout.container.HBox'],
            xtype: 'layout-horizontal-box',
            width : 600,
            frame :true,
            items : [{
               title: 'Panel 1',
               html : 'Panel with flex 1',
               flex : 1
            },{
               title: 'Panel 2',
               html : 'Panel with flex 2',
               flex : 2
            },{
               title: 'Panel 3',
               width: 150,
               html : 'Panel with width 150'
            },{
               title: 'Panel 4',
               html : 'Panel with flex 1',
               flex : 1
            }]
         });
      });
   </script>
</head>
<body>
</body>
</html>

これにより、次の結果が生成されます–