sencha如何从记录中获取字符串

how sencha get string from records

这是我的代码。我想从记录中获取 "data" 和 "earn" 字符串类型。

storeId.load({
        callback: function(records, operation, success){
            console.log(records);
            //Ext.getCmp('datalabel').setData({test: 'Foo'});                
        }
    });

在 chrome 控制台中:

0: Ext.apply.create.f
_data: Object    
data: Object
data: "300000"---------------i want
earn: "100000"---------------i want
id: "ext-record-2"
__proto__: Object
id: "ext-record-2"
internalId: "ext-record-2"
modified: Object
phantom: true
raw: Object
stores: Array[1]
__proto__: Object
length: 1
__proto__: Array[0]

迭代记录或按索引获取记录:

storeId.load({
    callback: function(records, operation, success){
        Ext.each(records, function(record) {
            console.log(record.get('data'));
            console.log(record.get('earn'));
        });

        // or

        var recordByIndex = records[0];
        console.log(recordByIndex.get('data'));
        console.log(recordByIndex.get('earn'));
    }
});