商店加载后 ExtJ 的事件

Dav*_*vid 4 extjs

我想在 storeLoad() 之后在 ExtJS 网格中触发一个事件。除了渲染之后,还有什么我可以使用的事件。

afterrender: function(grid) {
            var store = grid.getStore();
            if (store.isLoaded()) {
               // not getting debugger here.
            }
        },
Run Code Online (Sandbox Code Playgroud)

Lud*_*ltz 6

只需在您的商店中使用 load 事件:

var store = grid.getStore();
store.on('load', function(){
    //Your function here
});
Run Code Online (Sandbox Code Playgroud)

编辑:您应该检查商店是否已加载:

var handler = function(){ /* Your function here */ }
if (store.isLoaded()) {
    handler.apply(this);
} else {
    store.on('load', handler, this);
}
Run Code Online (Sandbox Code Playgroud)