2011-09-16 73 views
0

我正面临有关为网格重新加载商店的问题。Ext JS加载店

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

这是我的商店。商店的数据是动态添加的。问题出现在我想刷新网格以更改网格中的行颜色之后。所以我需要重新加载商店。但我不能拨打all.road()。出现“无法读取属性”长度“未定义”的错误。

这里有什么问题?

+0

,你能告诉我们你的JSON。 – dursun

回答

-1

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

例如:

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

不,你可以做到,但不是必须的,它取决于你的json的外观... – nscrob

+0

你是对的,我们需要首先看到json。 – dursun