简体   繁体   English

未捕获的类型错误:无法使用 Sencha 读取未定义的属性“应用”

[英]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.

相关问题 Sencha-Touch:未捕获的TypeError:无法读取未定义的属性'proxy' - Sencha-Touch: Uncaught TypeError: Cannot read property 'proxy' of undefined D3和Javascript:未捕获的TypeError:无法读取未定义的属性“应用” - D3 and Javascript: Uncaught TypeError: Cannot read property 'apply' of undefined 未捕获(承诺):类型错误:无法读取 ionic 2 应用程序中未定义的属性“应用” - Uncaught (in promise): TypeError: Cannot read property 'apply' of undefined in ionic 2 app 未捕获的TypeError:无法读取未定义的移相器的属性“apply” - Uncaught TypeError: Cannot read property 'apply' of undefined phaser 未捕获的TypeError:无法使用phaser读取未定义的属性“apply” - Uncaught TypeError: Cannot read property 'apply' of undefined with phaser LinkedIn JavaScript SDK-未捕获的TypeError:无法读取未定义的属性“ apply” - LinkedIn JavaScript SDK - Uncaught TypeError: Cannot read property 'apply' of undefined 未捕获的类型错误:无法读取未定义的 react redux 的属性“apply” - Uncaught TypeError: Cannot read property 'apply' of undefined react redux JS错误-未捕获的TypeError:无法读取未定义的属性“应用” ** - JS error - Uncaught TypeError: Cannot read property 'apply' of undefined** SharePoint 在线未捕获类型错误:无法读取未定义的属性“应用” - SharePoint Online Uncaught TypeError: Cannot read property 'apply' of undefined Uncaught TypeError:无法读取未定义的Google Maps的属性“ apply” - Uncaught TypeError: Cannot read property 'apply' of undefined Google Maps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM