Ext.Loader.setConfig({enabled: true}); Ext.require([ 'Ext.tip.QuickTipManager', 'Ext.container.Viewport', 'Ext.layout.*', 'Ext.form.Panel', 'Ext.form.Label', 'Ext.grid.*', 'Ext.data.*', 'Ext.tree.*', 'Ext.selection.*', 'Ext.tab.Panel' ]); Ext.onReady(function(){ Ext.tip.QuickTipManager.init(); Ext.create('Ext.window.Window', { height: 130, modal: true, closable: false, width: 350, layout: 'fit', items: [ { xtype: "form", frame: true,width: 430, id: "frmLogin", defaults:{anchor: '100%'}, items: [ { xtype: "textfield", id: "usuario", name: "usuario", allowBlank: false, fieldLabel: "Usuario" }, { xtype: "textfield", id: "pass", name: "pass", inputType: 'password', allowBlank: false, fieldLabel: "Password" } ] } ], buttons: [ {text: "Entrar" , handler: function(){ var form = Ext.getCmp("frmLogin").getForm(); if (form.isValid()) { form.url = 'controllers/loginController.php?action=login'; Ext.Msg.wait("Espere un momento"); form.submit({ success: function(form, action) { if(action.result.success) { window.document.location.href="http://tsf.tecnologiasoptimizadoras.com/?rnd="+Math.floor((Math.random() * 9999) + 1); } else { Ext.Msg.alert('Error', "Usuario/Password erroneo"); } }, failure: function(form, action) { Ext.Msg.alert('Error', "Usuario/Password erroneo"); } }); } }}] }).show(); });