控制器似乎没有运行

时间:2014-01-31 15:10:46

标签: extjs sencha-touch sencha-touch-2

我的控制器中似乎没有任何东西可以正常工作。所以,我已经检查了Google Chrome网络开发的网络标签,我注意到Controller文件没有运行。我有Ctrl找到我的控制器的名称,我找不到它。这是它的印刷品。

enter image description here

这是我的主要应用文件

App.js

Ext.application({
name: 'UniSelect',

requires: ['Ext.MessageBox',],

controller: ['Controleur'],

views: ['Main','ListeClient'],

model: ['ListeClient'],  

store: ['ListeClient'],

icon: {
    '57': 'resources/icons/Icon.png',
    '72': 'resources/icons/Icon~ipad.png',
    '114': 'resources/icons/Icon@2x.png',
    '144': 'resources/icons/Icon~ipad@2x.png'
},

isIconPrecomposed: true,

startupImage: {
    '320x460': 'resources/startup/320x460.jpg',
    '640x920': 'resources/startup/640x920.png',
    '768x1004': 'resources/startup/768x1004.png',
    '748x1024': 'resources/startup/748x1024.png',
    '1536x2008': 'resources/startup/1536x2008.png',
    '1496x2048': 'resources/startup/1496x2048.png'
},

launch: function() {
    // Destroy the #appLoadingIndicator element
    Ext.fly('appLoadingIndicator').destroy();

    // Initialize the main view
    Ext.Viewport.add(Ext.create('UniSelect.view.Main'));
},

onUpdated: function() {
    Ext.Msg.confirm(
        "Application Update",
        "This application has just successfully been updated to the latest version. Reload now?",
        function(buttonId) {
            if (buttonId === 'yes') {
                window.location.reload();
            }
        }
    );
}
});

控制台甚至不打印我控制器文件最开头的“RUNS”字符串。

Controleur.js

console.log('RUNS');

Ext.define('UniSelect.controller.Controleur', {
extend: 'Ext.app.Controller',

requires: ['Ext.MessageBox'],                  

config: {
    refs: {

        liste: '#listeclient',

        liste: {
            selector: '#ListeClient',
            xtype: 'listeclient',
            autoCreate: true,
            forceCreate: true
        }


    },
    control: {
        liste: {
            itemtap: 'selectionClient'
        },
    }
},

selectionClient: function() {

    console.log('itemTap-RUNS');

  },

launch: function() {

    this.selectionClient();
    console.log('heyeye');
}
});

2 个答案:

答案 0 :(得分:0)

我认为问题是应用程序定义中的配置数组应该是controllers而不是controller

答案 1 :(得分:0)

好的,它终于有效了。我点击IDE(Eclipse)中的控制器文件,然后选择“Run on server”运行它。

当我刚刚构建项目并运行整个项目时,我不知道为什么它不起作用。

感谢您的帮助chinabuffet

相关问题