如何从外部控制器功能中调用控制器功能,如在sencha touch中的全局功能

kon*_*dal 6 extjs sencha-touch extjs4 sencha-touch-2 cordova

如何从外部控制器功能调用内部控制器的功能,如可能是手机间隙回叫功能

这是控制器侧面定义的功能

  function onDeviceReady() {
    //do ALL your localstorage stuff here
    console.log('In onDeviceReady() function');
    somefunction();// this is not working
  }
Run Code Online (Sandbox Code Playgroud)

这是控制器类

     Ext.define('FCELB.controller.LoginController', {
        extend: 'Ext.app.Controller',
        config: {
            refs: {
                username: '#username',
                password: '#password'
            },

            }

        },      

        init: function () {
            console.log('Login controller');
            document.addEventListener("deviceready", onDeviceReady, false);
            //onDeviceReady();
        },

        somefunction:function(){
            //some functionality
        }

   });
Run Code Online (Sandbox Code Playgroud)

如何somefunction()从上面调用onDereadyready()函数?

Vis*_*swa 13

FCELB.app.getController('LoginController').somefunction();  
Run Code Online (Sandbox Code Playgroud)

哪里

FCELB - 申请名称

LoginController - 控制器的名称

somefunction - 功能名称