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>

  • 相关阅读:
    [原创]SQL 把表中某一个列按照逗号拼接成一行
    [原创]SQL 把表中字段存储的逗号隔开内容转换成列表形式
    JQuery DataTables相关
    Jquery相关
    json字串主从表无法转成对像
    FastReport.net 使用 WebForm 实现打印 最简单版
    c# .netframwork 4.0 调用 2.0时报错 混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。
    FastReport.net 使用 Winform WebForm打印
    asp.net dev xtraReporting(一)静态页面
    C# DataTable转json 时间格式化
  • 原文地址:https://www.cnblogs.com/summer520/p/3118329.html
Copyright © 2011-2022 走看看