【问题标题】:Ext JS load storeExt JS 加载存储
【发布时间】:2011-11-18 12:24:37
【问题描述】:

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

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

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

这里有什么问题?

【问题讨论】:

    标签: extjs grid refresh store


    【解决方案1】:

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

    示例:

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

    【讨论】:

    • 不......你没有,你可以做到,但不是必须的,这取决于你的 json 看起来如何......
    猜你喜欢
    • 2013-09-14
    • 1970-01-01
    • 2020-02-17
    • 2017-07-12
    • 1970-01-01
    • 2013-02-11
    • 1970-01-01
    • 2012-02-11
    • 2022-06-13
    相关资源
    最近更新 更多