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

i am having extjs GridPanelwhen i load store:I do Ext.getBody().mask();Grid 'afterrender' eve

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

            },
        });
    }
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744616621a4584089.html

相关推荐

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

    i am having extjs GridPanelwhen i load store:I do Ext.getBody().mask();Grid 'afterrender' eve

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信