- Ext JS 3.0 Cookbook
- Jorge Ramon
- 173字
- 2021-04-01 13:43:47
Laying out items within a container using CSS-style absolute positioning
Sometimes, you need to position components using the standard X and Y coordinates. In this recipe, I position two panels in the container using an absolute layout. The following screenshot shows how the end result will look like:

How to do it...
- Create a couple of panels that will be absolute-positioned:
panel1=new Ext.Panel({ title: 'Panel 2', // When using absolute layouts, // you need to specify the coordinates. x: 50, y: 50, width: 200, height:200, html: 'Positioned at x:50, y:50' }); panel2=new Ext.Panel({ title: 'Panel 2', x: 200, y: 200, width: 300, height: 150, html: 'Positioned at x:100, y:100' });
- Create a container for the panels:
var viewport=new Ext.Viewport({ // Position items within this container using // CSS-style absolute positioning. layout:'absolute', items:[panel1, panel2] });
推薦閱讀
- PrestaShop 1.3 Theming – Beginner’s Guide
- ChronoForms 3.1 for Joomla! site Cookbook
- Unity Game Development Essentials
- 中文版Photoshop CC平面設計從入門到精通(唯美)
- Blender 2.5 Materials and Textures Cookbook
- ANSYS Workbench中文版超級學習手冊
- Puppet權威指南
- 機械CAD軟件應用入門指導書
- 手把手教你學成PPT高手
- SEO搜索引擎優化:基礎、案例與實戰(第2版)
- 商務數據可視化(全彩微課版)
- 中文版Photoshop CS6基礎培訓教程(移動學習版)
- 動手學推薦系統:基于PyTorch的算法實現(微課視頻版)
- Altium Designer 21(中文版)電子設計速成實戰寶典
- 深度學習之攝影圖像處理:核心算法與案例精粹