문제

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