如何从外部控制器功能调用内部控制器的功能,如可能是手机间隙回叫功能 这是控制器侧面定义的功能 function onDeviceReady() { //do ALL your localstorage stuff here console.log('In onDeviceReady() function
这是控制器侧面定义的功能
function onDeviceReady() {
//do ALL your localstorage stuff here
console.log('In onDeviceReady() function');
somefunction();// this is not working
}
这是控制器类
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
}
});
如何从上面的onDeviceready()函数调用somefunction()?
FCELB.app.getController('LoginController').somefunction();
哪里
FCELB – 申请名称
LoginController – 控制器的名称
somefunction – 功能名称
