最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - extjs grid real full afterrender event? - Stack Overflow

programmeradmin2浏览0评论

i am having extjs GridPanel

when i load store:

I do Ext.getBody().mask();

Grid 'afterrender' event fires first

Store 'load' event fires second

I attached unmask function to  store load 'event'

but there are few moments after that event, when i see white grid (between unmask and rows populating).

what is the proper way to unmask on real full afterrender event? i mean - when all rows are rendered.

Thanks

i am having extjs GridPanel

when i load store:

I do Ext.getBody().mask();

Grid 'afterrender' event fires first

Store 'load' event fires second

I attached unmask function to  store load 'event'

but there are few moments after that event, when i see white grid (between unmask and rows populating).

what is the proper way to unmask on real full afterrender event? i mean - when all rows are rendered.

Thanks

Share Improve this question edited Jul 31, 2012 at 9:13 Lev Savranskiy asked Jul 31, 2012 at 8:59 Lev SavranskiyLev Savranskiy 4302 gold badges7 silver badges19 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

I was going to suggest the gridview's loadMask config as covered here in the docs. But I noticed that it wasn't working for me for some reason.

If it doesn't work for you either, just use the gridview's refresh event as covered here. It will only fire after the data is fully loaded into the grid. You can attach it through your gridpanel's viewConfig config like so:

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');
            }
        }
    },
});

Or if you are using MVC app architecture:

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');
                }

            },
        });
    }
});
发布评论

评论列表(0)

  1. 暂无评论