PDA

View Full Version : ExtAjax.Request with respone text ?



boston-george
8 Feb 2011, 4:42 AM
How can i manage response text in a Ext.Ajax.request?



Ext.Ajax.request({
url:'sside_login.php',
params:{
action:'login',
user:Ext.getCmp('ioUser').getValue(),
pass:Ext.getCmp('ioPwd').getValue(),
},
method:'POST',
success: function(result, request){
var res = new Object();
res = Ext.util.JSON.decode(result.responseText)
box.hide();
Ext.MessageBox.alert('Alert',res.message);
},
failure: function(result, request){
Ext.MessageBox.alert('Alert','error');
}
});


this is php server side:


if ($_REQUEST['action'] == 'login') {

$mess = "OK";
$risp = array("failure" => true, "message" => $mes);
echo json_encode($risp);

}


how can i show alert window in FAILURE FUNCTION??

thanks

boston-george
9 Feb 2011, 1:44 AM
Some help??

thanks