Ext.js – Column Layout

In this guide, we will discuss Column Layout in Ext.js . This layout is to show multiple columns in the container. We can define a fixed or percentage width to the columns. The percentage width will be calculated based on the full size of the container.

Syntax

Following is a simple syntax to use the Column layout.

layout: 'column'

Example

Following is a simple example showing the usage of Column layout.

<!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 : 'column' ,
               xtype: 'layout-column',
               requires: ['Ext.layout.container.Column'],
               width : 600,
               
               items: [{
                  title : 'First Component width 30%',
                  html : 'This is First Component',
                  columnWidth : 0.30
               },{
                  title : 'Second Component width 40%',
                  html : '<p> This is Second Component </p> <p> Next line for second component </p>',
                  columnWidth : 0.40
               },{
                  title : 'Third Component width 30%',
                  html : 'This is Third Component' ,
                  columnWidth : 0.30
               }]
            });
         });
      </script>
   </head>
   
   <body>
   </body>
</html>

Next Topic : Click Here

This Post Has 3 Comments

Leave a Reply