extjs网格真实的完全后渲染事件

extjs grid real full afterrender event?

本文关键字:事件 网格 真实 extjs      更新时间:2024-05-12

我有extjs GridPanel

当我加载存储时:

I do Ext.getBody().mask();
Grid 'afterrender' event fires first
Store 'load' event fires second
I attached unmask function to  store load 'event'

但在那之后的几分钟内,当我看到白色网格(在取消掩码和填充行之间)时。

在真实的完全后渲染事件中,取消掩码的正确方法是什么?我的意思是,当所有的行都被渲染时。

感谢

我本来打算在文档中介绍gridview的loadMask配置。但我注意到,由于某种原因,它对我不起作用。

如果它也不适用,只需使用此处介绍的gridview的refresh事件。它只有在数据完全加载到网格中后才会启动。你可以通过你的网格面板的viewConfig配置来连接它,如下所示:

Ext.create('Ext.grid.Panel', {
    title: 'My Grid Panel',
    // ... other grid panel configs
    viewConfig: {
        listeners: {
            refresh: function(gridview) {
                console.log(gridview);
                console.log('is fully loaded');
            }
        }
    },
});

或者,如果您正在使用MVC应用程序架构:

Ext.define('MyApp.controller.MyController', {
    extend: 'Ext.app.Controller',
    models: ['MyModel'],
    stores: ['MyStore'],
    views:  ['MyGridPanel'],
    init: function() {
        var me = this;
        me.control({
            // ... other event handlers
            'mygridpanel > gridview': {
                refresh: function(gridview) {
                    console.log(gridview);
                    console.log('is fully loaded');
                }
            },
        });
    }
});