更新记录:

2022年6月1日 开始。

2022年6月4日 发布。

1.说明

使用列布局,可以将容器拆分为特定大小的列,并将子组件放置在这些列中。

可以设置子组件宽度值为: 百分比(相对父容器宽度) 或者 绝对值。

注意:子项组件总是左对齐。

2.设置布局方法

在父容器中设置

layout: 'column'
//或者
layout: {
type: 'column'
}

然后在子组件中使用columnWidth属性设置宽度。

注意:

1.如果设置为百分比,所有子项的columnWidth属性的总和应等于1

2.还可以定义固定宽度。

3.如果子组件宽度同时包含绝对值和百分比,则先减去绝对值再计算百分比。

4.column布局不会管理子组件的高度,最好为父容器设置autoScroll:true

//使用百分比
columnWidth: 0.4,
//使用绝对值
columnWidth: 350,

3.适合和不适合场景

适合场景:

1.将多个子组件进行按多个列进行布局。

2.部分子组件的宽度为固定值,部分子组件的宽度为相对值。

不适合场景:

4.实例

4.1实例:使用列布局



代码:

{
xtype: 'panel',
width: 700,
height: 400,
layout: 'column',
autoScroll: true,
items: [
{
xtype: 'panel',
title: 'Panel Panda 666 com', //哈哈
columnWidth: 0.4,
height: 400,
},
{
xtype: 'panel',
title: 'Panel panda com 666',
columnWidth: 0.6,
layout: 'center',
height: 400
},
{
xtype: 'panel',
title: 'Panel 3',
width: 150,
height: 400
}
]
}

4.2实例:使用列布局混合固定宽度



代码:

{
title: 'Column Layout - Mixed',
width: 450,
height: 250,
layout: 'column',
items: [
{
title: 'Column 1',
width: 100
},
{
title: 'Column 2',
columnWidth: 0.7
},
{
title: 'Column 3',
columnWidth: 0.3
}
],
}

4.3实例:使用百分比



代码:

{
xtype: 'panel',
layout : 'column',
scrollable: true,
requires: ['Ext.layout.container.Column'],
width : 800,
height: 300,
items: [
{
title : 'First Component width 30%',
html : 'This is First Component',
columnWidth : 0.30,
height:800,
},
{
title : 'Second Component width 40%',
html : 'This is Second Component',
columnWidth : 0.40
},
{
title : 'Third Component width 30%',
html : 'This is Third Component' ,
columnWidth : 0.30
}
]
}

4.4实例:使用百分比对半分



代码:

{
xtype: 'panel',
width: 400,
height: 300,
layout: 'column',
items: [
{
xtype: 'panel',
title: 'Child Panel 1',
height: 100,
columnWidth: 0.5
},
{
xtype: 'panel',
title: 'Child Panel 2',
height: 100,
columnWidth: 0.5
}
]
}

ExtJS 布局-Column布局(Column layout)的更多相关文章

  1. Extjs Column布局常见问题及解决方法

    原文地址:http://blog.csdn.net/weoln/article/details/4339533 第一次用Extjs的column布局时遇见了很多问题,记录下来,供大家参考.column ...

  2. 60.extjs-布局 (在column布局中使用fieldset 和 在fieldset中使用column布局)

    转自:https://blog.csdn.net/snn1410/article/details/8817821/ 在标准的html中,需要把输入项都放到fieldset中,一次来显示分组结构.虽然E ...

  3. ExtJS 布局-Table布局(Table layout)

    更新记录: 2022年6月1日 开始. 2022年6月10日 发布. 1.说明 table布局类似表格,通过指定行列数实现布局. 2.设置布局方法 在父容器中指定 layout: 'table' la ...

  4. ExtJS 布局-HBox 布局(HBox layout)

    更新记录: 2022年6月11日 更新文章结构. 2022年6月8日 发布. 2022年6月1日 开始. 1.说明 hbox布局与column布局几乎相同,但hbox允许拉伸列的高度. 既可以在水平方 ...

  5. flutter 页面布局 Paddiing Row Column Expanded 组件

    Flutter Paddiing 组件 在 html 中常见的布局标签都有 padding 属性,但是 Flutter 中很多 Widget 是没有 padding 属 性.这个时候我们可以用 Pad ...

  6. 10Flutter页面布局 Padding Row Column Expanded组件详解:

    Padding组件: main.dart import 'package:flutter/material.dart'; import 'res/listData.dart'; /* flutter页 ...

  7. 页面布局 Paddiing Row Column Expanded 组件详解

    一.Paddiing 组件     padding    EdgeInsetss 设置填充的值     child  组件    return Padding(     padding: EdgeIn ...

  8. 12.Quick QML-QML 布局(Row、Column、Grid、Flow和嵌套布局) 、Repeater对象

    1.Row布局 Row中的item可以不需要使用anchors布局,就能通过行的形式进行布局. 并且item可以使用Positioner附加属性来访问有关其在Row中的位置及其他信息. 示例如下所示, ...

  9. ExtJS 布局-VBox布局(VBox layout)

    更新记录: 2022年6月11日 优化文章结构. 2022年6月9日 发布. 2022年6月1日 开始. 1.说明 vbox布局类似auto布局,将子组件一个接一个垂直向下放置,既可以在水平方向也可以 ...

随机推荐

  1. Python入门-面向对象-装饰器

    1.变量作用域 全局变量和局部变量 #变量是有作用域的,分为全局变量和局部变量 num = 100 #这是全局变量 def change(): """ 查看变量作用域 & ...

  2. c++对c的拓展_引用的基本用法

    实质:取别名 格式:原类型&别名=原变量名: 注意:1.定义时必须初始化 2.初始化后不能够改变指向 3.不可对Null进行引用 4.可对任意类型取别名包括数组(int (&别名)[个 ...

  3. python输出二维数组中,每行N个最大值的索引

    `import heapq import numpy as np import random a = np.random.randint(50,size= (4,5)) a = np.array(a) ...

  4. SSM实现个人博客-day01

    1.需求分析 项目源码免费下载:SSM实现个人博客 有问题请询问vx:kht808

  5. 帝国cms发布文章对哪些数据表做了操作

    帝国cms 发布一篇文章会影响哪些数据表 insert into phome_enewsfile_1(pubid,filename,filesize,adduser,path,filetime,cla ...

  6. linux中sort、uniq、cut、tr、wc命令的使用

    文本处理命令 1.sort命令 使用场景 : 用于将文件内容加以排序(可以和cat一起用) 参数 作用 -n 依照数值的大小排序 -r 以相反的顺序来排序(默认只比较第一个数,-rn是按所有数值比较) ...

  7. 想减少代码量,快设置一个有感知的 Aware Spring Bean

    摘要:正常情况下,Spring 中的 Bean 对 Spring 是无感知的,Spring 框架提供了这种扩展能力,能让一个 bean 成为有感知的. 本文分享自华为云社区<有感知的 Aware ...

  8. 2021.11.09 P2292 [HNOI2004]L语言(trie树+AC自动机)

    2021.11.09 P2292 [HNOI2004]L语言(trie树+AC自动机) https://www.luogu.com.cn/problem/P2292 题意: 标点符号的出现晚于文字的出 ...

  9. python3-认识内置对象,运算符,表达式

    1 . 认识内置对象 在python中一切皆对象, 整数,实数,复数,字符串,列表,元组,字典,集合,zip,  map, enumerate, filter , 函数 ,类 , 分类:内置对象,标准 ...

  10. MATLAB R2019b超详细安装教程(附完整安装文件)

    摘要:本文详细介绍Matlab的安装步骤,为方便安装这里提供了完整安装文件的百度网盘下载链接供大家使用.从文件下载到证书安装本文都给出了每个步骤的截图,按照图示进行即可轻松完成安装使用.本文目录如首页 ...