Reputation: 263
How do I get the value from this object in EXT JS?!
{ "success" : "Some text message." }
I'm trying this :
success : function(resp, request) {
Ext.Msg.alert('alert title', resp.responseText);
}
Upvotes: 0
Views: 194
Reputation: 851
it depends on what are you using to communicate with server
if you are using Ext.Ajax.request
:
Ext.Ajax.request({
url: 'page.php',
params: {
id: 1
},
success: function(response){
var text = Ext.decode(response.responseText);
alert(text.success)
// process server response here
}
});
but if you are using form.submit(), success
in json must be true or false, it indicates was response successful or not.
Upvotes: 1