Ext JS:如何重新加载多个商店?

时间:2018-04-05 16:58:13

标签: javascript extjs store reload

我在ViewModel中定义了几个商店,我有一个按钮可以将所有商店重新加载到一起。我希望仅使用一个var并仅使用Ext.getStore('sampleStore')一次选择所有var,而不是创建多个reload()来支持refreshPanel: function () { // This way only one of stores is reloading, its sampleStore1. var panelStores = Ext.getStore('sampleStore1', 'sampleStore2', 'sampleStore3'); panelStores.reload(); }

这是一个非完全工作代码段;

ViewModel

这里是stores: { // I've tried to give a storeId name but ofcourse did not work! //storeId: 'adminbonus', sampleStore1: { storeId: 'sampleStore1', ... }, sampleStore2: { storeId: 'sampleStore2', ... }, sampleStore3: { storeId: 'sampleStore3', ... }, }, //And using several formulas with chainedstore or bindTo configs formulas: {} 中定义的商店:

PIL.ImageDraw.ImageDraw.polygon( xy, fill = None, outline = None )

1 个答案:

答案 0 :(得分:3)

尝试类似的东西:

    var panelStores = ['sampleStore1', 'sampleStore2', 'sampleStore3'];

    Ext.each(panelStores, function(eachStore) {
         var store = Ext.getStore(eachStore);
            if(store){
                store.reload();
            }
    }