Question

I am trying to display console.log(r.get('info')) but, i am getting the output as (an empty string). What might have caused this error ?

var myst = Ext.getStore('MyStore');    
var r = myst.getAt(0);
myst.on('load', function() {
    r = myst.getAt(0);
    console.log(r);
    console.log(r.get('info'));
});


UPDATE 1

MODEL

Ext.define('MyApp.model.MyModel', {
    extend: 'Ext.data.Model',

    fields: [

        {
            name: 'info'
        }
    ]
});

UPDATE 2

I actually get Object { phantom=true, internalId="ext-record-18", raw={...}, more...} when i print console.log(r)'and inside raw, i see info:"myname".

Was it helpful?

Solution

To display array or objects try console.dir(object).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top