我有一个简单的(user_data
)商店。我加载这个商店:
user_data_store.load({
scope: this,
callback: function(g, records, operation, success) {
console.log(g);
var login_name = ???
},
});
这是一个简单的json:
[{
"login_id" : "1",
"login_name" : "test",
"login_email" : "test@test.com",
"login_mobile" : "11111111"
}]
但我不知道如何获取login_name? (测试)
答案 0 :(得分:1)
试试这种方式
user_data_store.load({
scope: this,
callback: function(records, operation, success) {
console.log(records[0].get('login_name'));
},
});
答案 1 :(得分:0)
试试这个
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);
}
});
参考docs