extjs - Store with autoload true should not load on application launch

后端 未结 3 1078
误落风尘
误落风尘 2021-02-15 16:54

I have a grid linked to a store with autoLoad: true. The problem is that the store gets loaded on application launch, even if the view is created only later when ac

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-15 17:38

    You can add render handler to view which will call store load method and disable autoLoad.

    Example listener:

    Ext.define('Mb.view.winbiz.Owners', {
        extend: 'Ext.grid.Panel',
        [...],
    
        initComponent: function(){
            this.callParent();
            this.on('render', this.loadStore, this);
        },
    
        loadStore: function() {
            this.getStore().load();
        }
    });
    

提交回复
热议问题