Sencha touch 2 在sencha rouch 2中更改视口时运行javascript代码

Sencha touch 2 在sencha rouch 2中更改视口时运行javascript代码,sencha-touch-2,viewport,onload-event,Sencha Touch 2,Viewport,Onload Event,我有一些javascript代码需要在加载新页面时运行。但onload事件仅在应用程序启动时发生一次。当我使用animateActiveItem更改视口时,事件不会触发。如何实现这一点?您可能正在视口中查找activeitemchange事件: 您可能正在视口中查找activeitemchange事件: Ext.Viewport.on('activeitemchange', function(viewport, newPanel, oldPanel) { //do whatever he

我有一些javascript代码需要在加载新页面时运行。但onload事件仅在应用程序启动时发生一次。当我使用animateActiveItem更改视口时,事件不会触发。如何实现这一点?

您可能正在
视口中查找
activeitemchange
事件:


您可能正在
视口中查找
activeitemchange
事件:

Ext.Viewport.on('activeitemchange', function(viewport, newPanel, oldPanel) {
    //do whatever here
}