- 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.
- AI繪畫教程:Midjourney使用方法與技巧從入門到精通
- 擁抱開源(第2版)
- AutoCAD 2014 中文版從入門到精通
- SPSS進階分析與實務
- 新編AutoCAD 2016從入門到精通
- iPhone User Interface Cookbook
- Moldflow 2021模流分析從入門到精通(升級版)
- 巧學巧用Flash CS6制作動畫
- Photoshop數字圖像處理
- Photoshop CS6平面設計實戰從入門到精通(經典暢銷版)
- Scribus 1.3.5: Beginner's Guide
- 中文版3ds Max 2016/VRay效果圖制作實戰基礎教程(全彩版)
- Photoshop后期強:多重曝光專業技法寶典
- Photoshop新媒體美工設計(視頻指導版)
- Oracle E/Business Suite R12 Supply Chain Management