Extjs 4.0.7 设计复杂窗口的范例

给出比较全面的模态窗口的范例,供以后参考:

本例只是大概列出各控件的相关设置,没有进行精细话调整,各位可以自己去细化,熟悉各控件。

    var win = Ext.create('Ext.window.Window', {
        title: 'Resize Me',
        width: 600,
        height: 500,
        minWidth: 300,
        minHeight: 200,
        modal: true,
        plain: true,
        layout: 'anchor',
        fieldDefaults: {
                xtype: 'textfield'
        },
    items:[{
        xtype: 'panel',
        layout: 'column',
        items: [{
            layout: 'anchor',
            columnWith: .5,
            baseCls: 'x-plain',
            //defaults:[width:80],
            //labelWidth: 90,
            items: [{
                fieldLabel: '工作ID',
                xtype: 'textfield',
                width:200,
                labelWidth: 50,
                name: 'job_id',
                value: '22'
            }, {
                fieldLabel: '工作说明',
                xtype: 'textfield',
                name: 'job_desc',
                readOnly: true,   //是否可以输入
                value: ''
            }, {
                xtype: 'checkboxfield',
                name: 'checkbox1',
                fieldLabel: 'Checkbox',
                boxLabel: 'box label'
            }, {
                xtype: 'radiofield',
                name: 'radio1',
                value: 'radiovalue1',
                fieldLabel: 'Radio buttons',
                boxLabel: 'radio 1'
            }, {
                xtype: 'radiofield',
                name: 'radio1',
                value: 'radiovalue2',
                fieldLabel: '',
                labelSeparator: '',
                hideEmptyLabel: false,
                boxLabel: 'radio 2'
            }, {
                xtype: 'datefield',
                format: 'Y-m-d',
                value: '1990-01-01',   //new Date();  默认当前日期
                //readOnly:true,   //是否可以输入
                name: 'date1',
                fieldLabel: '出生年月'
            }, {
                xtype: 'textfield',
                name: 'password1',
                inputType: 'password',
                fieldLabel: '密码'
            }]
        }, {
            columnWith: .5,
            fieldDefaults: {
                xtype: 'textfield',
                labelAlign: 'right',
                labelWidth: 60,
                anchor: '100%'
            },
            items: [{
                fieldLabel: '性别',
                xtype: 'combobox',
                name: 'sex',
                queryMode: 'local',   //指明本地获取数据
                displayField: 'sex_name',
                valueField: 'sex_id',
                allowBlank: false,
                editable: false,
                //readOnly:true,
                store: new Ext.create('Ext.data.Store', {
                    fields:['sex_id','sex_name'],
                    data:[{'sex_id':'1','sex_name':'男'},{'sex_id':'0','sex_name':'女'}]
                }),
                value: '1'
            }, {
                fieldLabel: '年龄',
                xtype: 'numberfield',
                name: 'numberfield1',
                value: 5,
                minValue: 0,
                maxValue: 50
            }, {
                fieldLabel: '照片',
                inputType: 'image',
                xtype: 'textfield',
                width: 100,
                height: 100
            }]
        }]
    }, {
                width: 500,
                fieldLabel: '说明1',
                xtype: 'textfield',
                name: 'remark1',
                value: '22'
    },{
                  width: 500,
                fieldLabel: '说明2',
                xtype: 'textfield',
                name: 'remark2',
                value: '22'
    }],
        buttons: [{
            text: 'Send'
        }, {
            text: 'Cancel'
        }]
    });

    win.show();
    //formPanel.render('form-ct');
});
样式图:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

trassion

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值