Q:

Ext JS - How to get success property in custom json result object when i load store

When I store load, how can I get the success property??
load store: 
store.load({
scope: this,
callback: function(records, operation, success) {
    if (success) {
        console.log('success');
    } else {
        console.log('error');
    }
});

return json data:
{
"header" : {
    "success" : "true",
    "message" : "complete!"
},
"data" : [{
            "id" : 1,
            "userId" : 1,
            "subject" : "Document 1"
        },{
            "id" : 2,
            "userId" : 1,
            "subject" : "Document 2"
        }]}

I want get "success" property in "header" and use this in a condition of the if statement. 

A:

http://docs-origin.sencha.com/extjs/5.0/apidocs/#!/api/Ext.data.reader.Reader-cfg-successProperty
So where you define the store, you have to add a successProperty to the store's reader, which should be "header.success".
You can't use different successProperties for one store, depending on which operation you perform.

