Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the server response.responseText after store load extjs 4

I'm having one problem with getting the response.responseText from the server response in extjs 4.

Below is my code to load the store:

store.load({
    params: {
        'projectid': this.projectid
    },
    callback: function (records, operation, success, response) {
        console.log(records);
        console.log(response.responseText);
    }
});

Actually, when I made the request with the below function, I properly get the reponse.responseText.

Ext.Ajax.request({
    url: 'login/GetLoginCheck.action',
    method: 'GET',
    params: {
        'username': values['username'],
        'password': values['password']
        },
    scope: this,
    success: function(response) {
        Ext.Msg.alert(response.responseText);
        var redirect = response.responseText;
        window.location.href = "" + redirect + ".jsp";
    },
    failure: function(response) {
        Ext.Msg.alert('INVALID USERNAME OR PASSWORD');
    }
});

So please suggest me how can I get the response.responseText from the store.load() having a callback function.

like image 301
Yogendra Singh Avatar asked Apr 20 '12 06:04

Yogendra Singh


1 Answers

callback has 3 parameters... try this :

store.load({
    params: {
        'projectid': this.projectid
    },
    callback: function (records, operation, success) {
        console.log(operation.response.responseText);
    }
});
like image 177
scebotari66 Avatar answered Nov 03 '22 00:11

scebotari66