Extjs-container-panel

提供:Dev Guides
2020年6月23日 (火) 07:05時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

Ext.js-Ext.panel.Panelコンテナー

Ext.panel.Panel:通常のパネルにアイテムを追加できる基本的なコンテナーです。

構文

以下は、Ext.panel.Panelコンテナを作成する簡単な構文です。

Ext.create('Ext.panel.Panel', {
   items: [child1, child2]
  //this way we can add different child elements to the container as container items.
});

以下は、Ext.panel.Panelコンテナを示す簡単な例です。

<!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 () {
            var childPanel1 = Ext.create('Ext.Panel', {
               html: 'First Panel'
            });
            var childPanel2 = Ext.create('Ext.Panel', {
               html: 'Another Panel'
            });
            Ext.create('Ext.panel.Panel', {
               renderTo: Ext.getBody(),
               width: 100,
               height : 100,
               border : true,
               frame : true,
               items: [ childPanel1, childPanel2 ]
            });
         });
      </script>
   </head>

   <body>
   </body>
</html>

上記のプログラムは、次の結果を生成します-