So I have and Ext js application and in my application launch function at the bottom, after I draw components there is the next line of code:

Ext.ComponentManager.all.on('render', function(cmp) { console.log(cmp); });

I expect that all components go through this function before being rendered to user but it's not. can you give any suggestions what can be happening? Anyway, what I want to do is to catch render or beforerender event of all components in a single place. yeah my application uses MVC architecture

有帮助吗?

解决方案

In your controller you can add listeners for these events to all components using * as the component query:

this.control({
    '*': {
        beforerender: function(cmp) {
            console.log('beforerender: ' + cmp.id);
        },
        render: function(cmp) {
            console.log('render: ' + cmp.id);
        }
    }
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top