Jay Zee
Jay Zee

Reputation: 263

Get array value response from php in ext js

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

Answers (1)

LightNight
LightNight

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

Related Questions