Ext.js:Ext.form.Panel 容器

返回到:Ext.js 教程:集装箱

Ext.form.Panel:Form面板为表单提供了一个标准容器,它本质上是一个标准的Ext.panel.Panel,它自动创建一个用于管理任何Ext.form.field.Field对象的BasicForm。

语法

这里是创建Ext.form.Panel容器的简单语法。

Ext.create('Ext.form.Panel', {
   items: [child1, child2] // 这样我们可以将不同的子元素作为容器项添加到容器中。
});

例子

下面是一个简单的例子显示Ext.form.Panel容器。

<!DOCTYPE html>
<html>
<head>
    <link href="./ext-6.0.0/build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet">
    <script src="./ext-6.0.0/build/ext-all.js"></script>
    <script type="text/javascript">
        Ext.onReady(function () {
            var child1 = Ext.create('Ext.Panel',{     
                html: 'Text field' 
            });
            var child2 = Ext.create('Ext.Panel',{
                html: 'Text field' 
            });
            Ext.create('Ext.form.Panel', {
                renderTo: Ext.getBody(),
                width: 100,
                height : 100,
                border : true,
                frame : true,
                layout: 'auto',// auto is one of the layout type.
                items: [child1, child2]
            });
        });
    </script>
</head>
<body>
</body>
</html>

运行结果截图:

Ext.js:Ext.form.Panel 容器

返回到:Ext.js 教程:集装箱

作者:terry,如若转载,请注明出处:https://www.web176.com/extjs_api/11597.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2023年3月2日
下一篇 2023年3月2日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注