Sencha touch Sencha按钮无法从index.html运行

Sencha touch Sencha按钮无法从index.html运行,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,情况如下: 当用户打开我的应用程序时,他必须登录,并且它正在工作。当他将应用程序置于后台模式时,我想在他回来时再次显示我的身份验证视图。因此,在我的index.html中,我在标题中做了以下部分: <script type="text/javascript" charset="utf-8"> function onActive() { setTimeout(function() { Ext.getCmp('mainView').destroy();

情况如下:

当用户打开我的应用程序时,他必须登录,并且它正在工作。当他将应用程序置于后台模式时,我想在他回来时再次显示我的身份验证视图。因此,在我的index.html中,我在标题中做了以下部分:

<script type="text/javascript" charset="utf-8">
function onActive() {

   setTimeout(function() {
        Ext.getCmp('mainView').destroy();
        Ext.Viewport.add(Ext.create('MyApp.view.Authentication'));
        }, 0);
}
</script>
这是我的控制器:

config: {
    refs: {
        btnValidate: '#authent_validateButton',
    },
    control: {
        btnValidate : {
            tap : 'doAuthentication'
        }
    },
},

doAuthentication : function(){
    alert('you\'ve been authenticated'); //the alert does not appear the second time
}
我真的不明白!也许我的按钮无法从我的index.html中知道doAuthentication?好像我的视图不再绑定到我的控制器。。。
谢谢你的帮助

我对你的问题没有答案,但我知道所有应用程序代码都应该包含在app.js或任何链接的.js文件(需要:[{}])中,而index.html文件中没有。应用程序在index.html文件中没有对该外围代码的引用

config: {
    refs: {
        btnValidate: '#authent_validateButton',
    },
    control: {
        btnValidate : {
            tap : 'doAuthentication'
        }
    },
},

doAuthentication : function(){
    alert('you\'ve been authenticated'); //the alert does not appear the second time
}