0
votes

I am facing a problem about reload store for grid.

var all = Ext.create('Ext.data.Store', {
model:'LiveLogModel',
proxy: {
    type: 'memory',
    reader: {
        type: 'json',
        root: 'items'
    }
} 
});
all.insert(0,newRecords);

Here is my store. data of the store is added dynamically. The problem is after while I want to refresh grid for changing row colour in the grid. So I need to reload the store. However I cannot call all.road(). "Cannot read property 'length' of undefined" error appeared.

What's the problem here?

1

1 Answers

-1
votes

In your reader definition you need to specify "totalProperty", and other properties as well. and your json should have such attributes.

example:

reader: {
    totalProperty : 'total',
    successProperty : 'success',
    idProperty : 'id',
    root : 'data',
    messageProperty : 'message'
}