標籤:extjs
Ext.onReady(function () { var win = new Ext.Window({ title: "設定檔", width: 500, height: 320, plain: true, layout: "form", defaultType: "textfield", labelWidth: 45, bodyStyle: "padding-top: 10px; padding-left:10px;", //defaults:{anchor:"100%"}, items: [{ xtype: "panel", baseCls: "x-plain", layout: "column", items: [{ columnWidth: .5, layout: "form", defaults: { xtype: "textfield", width: 170 }, labelWidth: 45, baseCls: "x-plain", //bodyStyle:"padding-top: 15px; padding-left:10px;", items: [ { fieldLabel: "姓名" }, { fieldLabel: "年齡" }, { fieldLabel: "郵箱" }, { fieldLabel: "性別" }, { fieldLabel: "電話" }, { fieldLabel: "地址" } ] }, { columnWidth: .5, layout: "form", style: "padding:10px 10px 0 10px", //順序是 上 右 下 左,也就是順時針的方向 //bodyStyle:"padding-top: 15px; padding-left:10px;", labelWidth: 45, baseCls: "x-plain", items: [ { xtype: "textfield", inputType: "image", width: 160, height: 140, fieldLabel: "頭像" } ] } ] }, { fieldLabel: "公司", width: "400" }, { fieldLabel: "資料", width: "400" }, { fieldLabel: "說明", width: "400" }], showLock: false, listeners: { "show": function (win) { if (!win[‘showLock‘]) { win.findByType("textfield")[6].getEl().dom.src = "..."; win["showLock"] = true; } } }, buttons: [ { text: "OK" }, { text: "Cancel" } ] }); win.show(); }); </script>