var win = Ext.create("Ext.window.Window", {
                id: "myWin",
                title: "示例窗口",
                width: 500,
                height: 300,
                layout: "fit",
                modal: true, //透明
                closable: false,//右上角关闭按钮是否显示
                items: [
                    {
                        xtype: "form",
                        defaultType: 'textfield',
                        defaults: {
                            anchor: '100%',
                        },
                        fieldDefaults: {
                            labelWidth: 80,
                            labelAlign: "left",
                            flex: 1,
                            margin: 5
                        },
                        items: [
                            {
                                xtype: "container",
                                layout: "hbox",
                                items: [
                                    { xtype: "textfield", name: "name", fieldLabel: "目录", allowBlank: false },
                                    { xtype: "numberfield", name: "age", fieldLabel: "年龄", decimalPrecision: 0, vtype: "age" }
                                ]
                            }
                        ]
                    }
                ],
                buttons: [
                    { xtype: "button", text: "确定", handler: function () { this.up("window").close(); } },
                    { xtype: "button", text: "取消", handler: function () { this.up("window").close(); } }
                ]
            });
            win.show();

 

posted on 2016-03-17 12:57  智华  阅读(820)  评论(0)    收藏  举报