如何在ExtJS 4中实现流布局? [英] How to implement a flowlayout in ExtJS 4?

查看:82
本文介绍了如何在ExtJS 4中实现流布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用一个布局,其中组件像hbox一样水平添加,但是如果组件超出容器的边界,则移动到下一行。这与FlowLayout的摆动和弹性类似。

I want to use a layout where components are added horizontally like hbox but where upon adding if the component exceed the bounds of the container it is moved to the next line. This is similar to what FlowLayout is in swing and flex.

我在ExtJS 4.0中找不到任何可以实现这一点的布局。

I couldn't find any layout in ExtJS 4.0 that would achieve this.

所以我想知道如何做这个。我相当新的框架,所以任何指针都会很棒。

So I am wondering how I would go about doing this. I am fairly new to the framework so any pointers would be great.

推荐答案

你是否尝试使用ColumnLayout?如果没有指定columnWidth属性,子元素将从左到右进行css浮动:

Have you tried using ColumnLayout? If you don't specify the "columnWidth" properties, the child elements are css-floated from left to right:

 Ext.create('Ext.Panel', {
        width: 500,
        height: 280,
        title: "ColumnLayout Panel",
        layout: 'column',
        renderTo: document.body,
        items: [{
            xtype: 'panel',
            title: 'First Inner Panel',
            width:  250,
            height: 90
        },{
            xtype: 'panel',
            title: 'Second Inner Panel',
            width: 200,
            height: 90
        }, {
            xtype: 'panel',
            title: 'Third Inner Panel',
            width: 150,
            height: 90
        }]
  });

这篇关于如何在ExtJS 4中实现流布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆