Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Function Sencha Touch 2:launch()函数不';t火_Function_Extjs_Controller_Sencha Touch 2_Launch - Fatal编程技术网

Function Sencha Touch 2:launch()函数不';t火

Function Sencha Touch 2:launch()函数不';t火,function,extjs,controller,sencha-touch-2,launch,Function,Extjs,Controller,Sencha Touch 2,Launch,谁能给我解释一下为什么这个函数 launch:function(){console.log('launch');} 控制台中不显示'launch'word? 控制台中没有错误 好像我在一个合适的地方,一个合适的控制器里使用它 我想使用此函数将值传递给视图 其余所有功能(包括其他控制器功能)都可以正常工作 为什么它没有被触发?Ext.app.Controller的启动功能被不当地记录为配置而不是方法。我不确定这是否是你的问题,但它欺骗了我 因此,不是: Ext.define('MyControll

谁能给我解释一下为什么这个函数

launch:function(){console.log('launch');}

控制台中不显示
'launch'
word? 控制台中没有错误

好像我在一个合适的地方,一个合适的控制器里使用它

我想使用此函数将值传递给视图

其余所有功能(包括其他控制器功能)都可以正常工作


为什么它没有被触发?

Ext.app.Controller的启动功能被不当地记录为配置而不是方法。我不确定这是否是你的问题,但它欺骗了我

因此,不是:

Ext.define('MyController', {
    extend: 'Ext.app.Controller',

    config: {
        launch: function() { console.log('launch'); }
    }
}
应该是:

Ext.define('MyController', {
    extend: 'Ext.app.Controller',

    launch: function() { console.log('launch'); }        
}

您的控制器是否包含在Ext.app.Application控制器列表中?谢谢您的询问。是的。你能给我们看看你的app.js代码吗?你们在浏览器上看到了什么?