Hi there
I am trying to understand how Sencha Architect creates event listeners.
Look at the following example:
teamSettings.png
This creates the following code (only relevant parts shown):
Code:
Ext.define('MyApp.view.SettingsView', {
extend: 'Ext.form.Panel',
alias: 'widget.settingsView',
config: {
id: 'settingsView',
iconCls: 'settings',
items: [
{
xtype: 'fieldset',
itemId: 'teamSettings',
title: 'Team Einstellungen',
items: [
{
xtype: 'textfield',
itemId: 'teamCode',
label: 'Team Code',
labelWidth: '50%'
},
...
]
}
]
listeners: [
{
fn: 'onTeamCodeShow',
event: 'show',
delegate: '#teamCode'
},
{
fn: 'onTeamCodePainted',
event: 'painted',
delegate: '#teamCode'
},
{
fn: 'onTeamCodeInitialize',
event: 'initialize',
delegate: '#teamCode'
}
]
},
onTeamCodeShow: function(component, options) {
console.log("show");
},
onTeamCodePainted: function(component, options) {
console.log("painted");
},
onTeamCodeInitialize: function(component, options) {
console.log("initialize");
}
});
None of the events are logged in the console. If I change the listeners from hand to:
Code:
listeners: [
{
fn: 'onTeamCodeShow',
event: 'show'
//delegate: '#teamCode'
},
{
fn: 'onTeamCodePainted',
event: 'painted'
//delegate: '#teamCode'
},
{
fn: 'onTeamCodeInitialize',
event: 'initialize'
//delegate: '#teamCode'
}
]
All of the events are logged in the console.
Am I understanding something completely wrong here?
Thanks for your help.
Cheers,
Markus