zoukankan      html  css  js  c++  java
  • Ext.form.FormPanel中使用column布局(经典示例)

    转自:http://hi.baidu.com/java513/item/010f0c260c60a9899c63d1c6

    最终效果图:

     

     

     

    源代码:

    <html>

        <head>

            <title>04.form</title>

            <linkrel="stylesheet"type="text/css"href="../../resources/css/ext-all.css"/>

            <scripttype="text/javascript"src="../../adapter/ext/ext-base.js"></script>

            <scripttype="text/javascript"src="../../ext-all.js"></script>

            <scripttype="text/javascript"src="../../source/locale/ext-lang-zh_CN.js"></script>

            <scripttype="text/javascript">

    Ext.onReady(function(){

     

        Ext.QuickTips.init();

     

        var form = new Ext.form.FormPanel({

            labelAlign: 'right',

            labelWidth: 60,

            title: 'form',

            frame:true,

             450,

            url: 'form.jsp',

     

            items: [

            {//行1

                layout:'column',

                items: [

                //列

                { columnWidth:.5,layout: 'form', xtype: 'fieldset', title: '第一列', autoHeight: true, defaultType: 'textfield',

                    items: [{ fieldLabel: '元素' },

                            { fieldLabel: '元素' },

                            { xtype: 'panel', html: '<br>' }, //空元素,用于分割

                            { xtype: 'panel', html: '<center><img src="user_female.png" /></center>' } //html元素,插入图片

                           ]

                },

                //列

                { columnWidth:.5,layout: 'form', xtype: 'fieldset', title: '第二列', autoHeight: true, style: 'margin-left: 20px;', defaultType: 'textfield',

                    items: [{ fieldLabel: '元素a' },

                            { fieldLabel: '元素b' },

                            { fieldLabel: '元素c' }

                           ]

                }

                ]

            },

            

            

            {//行2

                xtype: 'fieldset',

                title: '第二行唯一列',

                autoHeight: true,

                items: [

                {//唯一列

                     345,

                    height: 100,

                    xtype: 'textarea',

                    fieldLabel: '唯一元素'

                }]

            }],

            

            

            buttons: [{

                text: '按钮',

                handler: function() {

                    form.getForm().submit();

                }

            }]

        });

        form.render("form");

     

    });

            </script>

        </head>

        <body>

            <divid="form"style="margin:100px;"></div>

        </body>

    </html>

  • 相关阅读:
    建立表空间和用户
    数据库设计的基本步骤
    ubuntu21.04(linux):安装python3+dlib+face_recognition
    ubuntu21.04(linux):为chrome安装vue-devtools(6.0.0 beta 14)调试插件
    ubuntu21.04(linux):安装node(14.17.1)和vue.js3.1环境
    ubuntu21.04(linux):用apt安装nginx/php/mysql/phpmyadmin(开发环境)
    ubuntu21.04(linux):安装webstorm2021.1
    linux:在fedora 32/ubuntu 21.04安装chrome 90浏览器
    spring boot单元测试之十六:junit5:用@Timeout注解判断测试运行是否超时(spring boot 2.4.4)
    spring boot单元测试之十五:用mockmvc测试返回异步结果的controller(spring boot 2.4.4)
  • 原文地址:https://www.cnblogs.com/summer520/p/3118329.html
Copyright © 2011-2022 走看看