PDA

View Full Version : Ext.Ajax.request event requestcomplete don´t work, I need sample



etp
28 Aug 2011, 7:45 PM
"beforerequest" is ok but "requestcomplete" run before a success function :


function respFunc (response){
alert('2 ');
}


function validarClte(id)
{

Ext.Ajax.on("beforerequest", function(){alert('1 ');}, this);
Ext.Ajax.on("requestcomplete", function(){alert('3 ');}, this);


Ext.Ajax.request({ url : 'CapaDatos/wsDatos.asmx/getCliente?id=' + id,
headers: { 'Content-Type': 'application/json; charset=utf-8' },
method: "POST",
success : respFunc,
failure : respFunc
});
}

mitchellsimoens
29 Aug 2011, 5:00 AM
So why not use the success, failure, or callback methods instead of a listener?