Ext.onReady(function(){ Ext.QuickTips.init(); var win; var link = Ext.get('get_auth'); var authform = new Ext.form.FieldSet({ xtype:'fieldset', autoHeight:true, defaults: {width: 190}, defaultType: 'textfield', items :[{ fieldLabel: 'Логин', name: 'login', allowBlank: false },{ fieldLabel: 'Пароль', name: 'password', inputType: 'password', vtype:'password', allowBlank: false }] }); var regform = new Ext.FormPanel({ labelWidth: 120, // label settings here cascade unless overridden url:'/user/extjs_auth.php', bodyStyle:'padding:5px 5px 0', width: 400, items: [authform] }); var win = new Ext.Window({ applyTo:'auth_win', modal: true, layout:'fit', width:400, height:160, closeAction:'hide', plain: true, items: regform, buttons: [{ text: 'Вход', type: 'submit', clientValidation: true, handler: function() { regform.getForm().submit({ waitMsg:'Обработка данных...', reset : false, success : function() { location='/glossary/detail.php?ID=1791'; win.hide(); }, failure: function(form, action){Ext.Msg.alert('Ошибка',"Проверьте правильность ввода данных.")} }); } },{ text:'Закрыть', handler: function(){win.hide();} }] }); if (link){ link.on('click', function(){ win.show(this); }); } });