ExtJS加载存储

ExtJS加载存储,extjs,grid,refresh,store,Extjs,Grid,Refresh,Store,我面临一个关于为网格重新加载存储的问题 var all = Ext.create('Ext.data.Store', { model:'LiveLogModel', proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); all.insert(0,newRecords); 这是我的商店。动态添加存储区的数据。问题是,当我想刷新网格以更改网格中的行颜色时

我面临一个关于为网格重新加载存储的问题

var all = Ext.create('Ext.data.Store', {
model:'LiveLogModel',
proxy: {
    type: 'memory',
    reader: {
        type: 'json',
        root: 'items'
    }
} 
});
all.insert(0,newRecords);
这是我的商店。动态添加存储区的数据。问题是,当我想刷新网格以更改网格中的行颜色时。所以我需要重新装填商店。但是我不能调用all.road()。出现“无法读取未定义的”属性“长度”错误


这里有什么问题

在阅读器定义中,您需要指定“totalProperty”,以及其他属性。您的json应该具有这样的属性

例如:

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

不你不需要,你可以这样做,但不是必须的,这取决于你的json看起来如何。。。