2013-03-13 101 views
0

我建立與煎茶觸摸2如何控制器初始化

我想的時刻,Controllers被初始化尚未運行一些代碼的應用程序,但我們的應用程序requires之前運行代碼已經被加載。

看着Ext.app.Application源代碼我真的很想攔截onProfilesLoaded調用。但我只是不知道該怎麼做。

回答

1

好吧,我想我自己想出來了。顯然你可以使用override功能來攔截。

Ext.define('MyApp.AppOverrides', { 
    override: 'Ext.app.Application', 

    onProfilesLoaded: function(){ 
     alert('Hey Mum, I just intercepted the call!'); 
     this.callParent(arguments); 
    } 
}); 
+0

有意思! :) – SachinGutte 2013-03-13 13:39:33