- Ext JS 3.0 Cookbook
- Jorge Ramon
- 284字
- 2021-04-01 13:43:48
Positioning components in multiple columns
Multicolumn layouts are pervasive today. They are a favorite choice when there is a need to display complex data, or to have an organized and easy-to-navigate GUI. This recipe explains how to set up this type of layout with Ext JS, as shown in the following screenshot:

How to do it...
- Create the columns of your layout:
var column1={ xtype:'panel', title: 'Column 1', columnWidth: .3, html: 'Width=30%' } var column2={ xtype: 'panel', title: 'Column 2', columnWidth: .5, html: 'Width=50%' } var column3={ xtype: 'panel', title: 'Column 3', width: 200, html: 'Width=200px' }
- Position the columns in a container that uses the column layout:
var container=new Ext.Viewport({ layout: 'column', defaults: { bodyStyle: 'padding:10px' }, items: [column1, column2, column3] });
Building a column layout requires you to create the panels that will constitute the columns. These columns are then added to a container that uses ColumnLayout
. (Note the use of the layout:'column'
configuration option.)
In a column
layout, the width of each column can be specified as a percentage or fixed width, but the height is allowed to vary, based on the content. The percentage width is set via the columnWidth
configuration property, which is included in the config
object of any panel added to it.
The specific rules about setting column widths can be found in the Ext JS documentation at http://extjs.com/deploy/dev/docs/?class=Ext.layout.ColumnLayout.
Note
Note that the concept of rows is absent in this layout. If you need precise control over the horizontal alignment of components across columns, you need to consider using a table layout.
- Creo Parametric 8.0中文版基礎(chǔ)入門一本通
- Illustrator CS6核心應用案例教程(全彩慕課版)
- MLOps實戰(zhàn):機器學習模型的開發(fā)、部署與應用
- 跟儲君老師學Excel極簡思維
- PHP應用開發(fā)與實踐
- Photoshop CC入門與進階
- Excel數(shù)據(jù)管理:不加班的秘密
- CorelDRAW 2020中文版入門、精通與實戰(zhàn)
- 正則表達式必知必會(修訂版)
- Building Websites with PHP/Nuke
- 零基礎(chǔ)學會聲會影2018(全視頻教學版)
- Word-Excel-PowerPoint 2010三合一辦公應用實戰(zhàn)從入門到精通(超值版)
- CINEMA 4D新手快速進階實例教學
- CorelDRAW X6平面設(shè)計與制作案例教程
- Professional Azure SQL Database Administration