我的控制器似乎沒有任何工作。所以,我檢查了Google Chrome網絡開發的網絡標籤,我注意到控制器文件沒有運行。我有Ctrl找到我的控制器的名稱,我找不到它。這是一個打印的場景。控制器似乎沒有運行
這是我主要的應用程序文件
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');
}
});
我剛試過。它不會改變任何東西。 :S – Pierre
網絡標籤中是否有404s?你的控制器在'controller'文件夾中? – chinabuffet
我在網絡選項卡中沒有發現任何404問題,我的控制器明確位於我的控制器文件夾中。 – Pierre