Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/05/2013, 09:11
ambichol
 
Fecha de Ingreso: febrero-2013
Ubicación: Lima
Mensajes: 301
Antigüedad: 11 años, 2 meses
Puntos: 5
Respuesta: hacer que un archivo de ext.js envie datos a un archivo php

newboy_master.....aun persiste mi problema.....te comparto el archivo .JS para que puedas verificarlo y orientarme si es que hay algo mal....
Código Javascript:
Ver original
  1. Ext.QuickTips.init();
  2.  
  3. Ext.onReady(function(){
  4.  
  5.     var fp = new Ext.FormPanel({
  6.         id: 'status-form',
  7.         renderTo: Ext.getBody(),
  8.         labelWidth: 75,
  9.         url: 'fake.php',
  10.         frame: true,
  11.         monitorValid:true,
  12.         width: 350,
  13.         padding: 10,
  14.         buttonAlign: 'right',
  15.         border: false,
  16.         bodyStyle: 'padding:10px 10px 0;',
  17.         defaults: {
  18.             anchor: '95%',
  19.             allowBlank: false,
  20.             selectOnFocus: true,
  21.             msgTarget: 'side'
  22.         },
  23.         items:[{
  24.             xtype: 'textfield',
  25.             fieldLabel: 'Login',
  26.             id: 'login',
  27.             name: 'login',
  28.             minLength: 2,
  29.             blankText: 'Ingrese su Usuario'
  30.         },{
  31.             xtype: 'textfield',
  32.             fieldLabel: 'Password',
  33.             id: 'password',
  34.             name: 'password',
  35.             minLength: 2,
  36.             inputType: 'password',
  37.             allowBlank:false,
  38.             blankText: 'Ingrese su Clave'
  39.         }],
  40.         buttons: [{
  41.             text: 'Ingresar',
  42.             formBind: true, //only enabled once the form is valid
  43.             disabled: true,
  44.             handler: function(){
  45.                 if(fp.getForm().isValid()){
  46.                     var sb = Ext.getCmp('form-statusbar');
  47.                     sb.showBusy('Validando...');
  48.                     fp.getEl().mask();
  49.                     fp.getForm().submit({
  50.                         success: function(form, action){
  51.                             Ext.Msg.alert('Success', action.result.msg);
  52.                             sb.setStatus({
  53.                                 text:'Validacion Completa::::Bienvenido...!'
  54.                             });
  55.                             fp.getEl().unmask();
  56.                             var redirect = "../../Main2/index.php";
  57.                             window.location = redirect;
  58.                         },
  59.                     failure: function(form, action) {
  60.                         Ext.Msg.alert('No tiene Acceso al Sistema', action.result.msg);
  61.                     }
  62.                     });
  63.                 }
  64.             }
  65.         },{
  66.             text: 'Cancelar',
  67.             formBind: true,
  68.             disabled: true
  69.             }]
  70.     });
  71.     new Ext.Panel({
  72.         title: 'Ingrese Datos',
  73.         renderTo: Ext.getBody(),
  74.         width: 350,
  75.         autoHeight: true,
  76.         layout: 'fit',
  77.         items: fp,
  78.         bbar: new Ext.ux.StatusBar({
  79.             id: 'form-statusbar',
  80.             defaultText: 'Ingrese Datos',
  81.             plugins: new Ext.ux.ValidationStatus({form:'status-form'})
  82.         })
  83.     });
  84.  
  85. });