2014-01-31 52 views
0

我的控制器似乎沒有任何工作。所以,我檢查了Google Chrome網絡開發的網絡標籤,我注意到控制器文件沒有運行。我有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/[email protected]', 
    '144': 'resources/icons/[email protected]' 
}, 

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(); 
      } 
     } 
    ); 
} 
}); 

控制檯甚至不打印「流程」字符串,它是在我的控制器的開始文件。

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'); 
} 
}); 

回答

0

我認爲問題是,在你的應用程序定義的配置陣列應該是controllerscontroller

+0

我剛試過。它不會改變任何東西。 :S – Pierre

+0

網絡標籤中是否有404s?你的控制器在'controller'文件夾中? – chinabuffet

+0

我在網絡選項卡中沒有發現任何404問題,我的控制器明確位於我的控制器文件夾中。 – Pierre

0

好吧,它終於有效。我點擊IDE(Eclipse)中的控制器文件,然後選擇「在服務器上運行」來運行它。

我不知道爲什麼它沒有工作,當我只是建設項目和整個項目運行。

謝謝你的幫助chinabuffet

相關問題