user3740961
user3740961

Reputation: 329

Extjs 5 store.load()

I have a simple (user_data) store. I load this store:

user_data_store.load({
    scope: this,
    callback: function(g, records, operation, success) {
         console.log(g);
         var login_name = ???
    },
});

This is a simple json:

[{
   "login_id" : "1",
   "login_name" : "test",
   "login_email" : "[email protected]",
   "login_mobile" : "11111111"
 }]

But I don't know how get login_name? (test)

Upvotes: 0

Views: 792

Answers (2)

Guilherme Lopes
Guilherme Lopes

Reputation: 4760

Try this way

user_data_store.load({
       scope: this,
       callback: function(records, operation, success) {
           console.log(records[0].get('login_name'));
       },
});

Upvotes: 1

MMT
MMT

Reputation: 2216

try this

store.load({
    scope: this,
    callback: function(records, operation, success) {
        // the operation object
        // contains all of the details of the load operation
        console.log(records[0].login_name);
    }
});

refer docs

Upvotes: 0

Related Questions