[英]Uncaught TypeError: Cannot read property 'apply' of undefined with Sencha
I have some problems with sencha touch.我对sencha touch有一些问题。 I have this simple code :
我有这个简单的代码:
items: [
{
name: "horo",
xtype: 'togglefield',
label: 'Horodateur ?',
labelWidth: '55%',
disabled: false,
listeners: {
beforechange: function (slider, thumb, newValue, oldValue) {
if (oldValue == 0 && newValue == 1) {
alert("toto");
}
},
change: function (slider, thumb, newValue, oldValue) {
if (oldValue == 0 && newValue == 1) {
alert("titi");
}
else if (oldValue == 1 && newValue == 0)
alert("tata");
}
}
},
And I have this error on my console :我的控制台上有这个错误:
Uncaught TypeError: Cannot read property 'apply' of undefined.
未捕获的类型错误:无法读取未定义的属性“应用”。
What's the problem ?有什么问题 ? My console say something else, maybe the
Controller.js
is the problem.我的控制台说了些别的,也许
Controller.js
是问题所在。
I had the same problem.我有同样的问题。 This problem can occur when you define some listeners and you did not define the function in your controller.
当您定义一些侦听器而您没有在控制器中定义函数时,可能会出现此问题。 I can see that beforechange and change have functions so maybe there are more items in your code that you have not shown here in the forum.
我可以看到 beforechange 和 change 有函数,所以也许你的代码中有更多你没有在论坛中显示的项目。 If there are listeners and the listener referer to a function that do not exist then you will get an error.
如果有侦听器和侦听器引用不存在的函数,那么您将收到错误消息。 "Uncaught TypeError: Cannot read property 'apply' of undefined"
“未捕获的类型错误:无法读取未定义的属性‘应用’”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.