PDA

View Full Version : events not worling with delegate #id



hschaefer123
24 Apr 2012, 4:44 AM
If a want to attach a 'initialize' event to a panel this works quite well by adding


listeners: [
{
fn: 'onContainerInitialize',
event: 'initialize'
}
]
now i want to give my panel an id the code is changed to

listeners: [
{
fn: 'onContainerInitialize',
event: 'initialize',
delegate: '#home'
}
]

but after using an id (itemId does not work too) the initial event is not fired!
Removing id removes delegate to work on again.

I am using SDK 2.0.1-rc

Is this a bug in SDK or inside Architect?

I also want to set scope: this config but scope is not available?!?
Trying to add scope with "ADD" button crashes Architect!

Cheers Holger

aconran
24 Apr 2012, 10:50 AM
I think whats happening here is when you use event delegation, that its already too late and the event has fired. We'll have to dig into it further.

Adding scope is not supporting and perhaps we need to add it to a specific exclude list so that you cannot add it.

magbeat
29 Apr 2012, 1:54 PM
I have a similar problem with the "initialize" event. (?)

The problem is, that I promoted a subcomponent to a class ("settingsView").
As I then added the "initialize" event to the promoted class. Now Sencha Architect auto-generates the following code:



{ fn: 'onSettingsViewInitialize',
event: 'initialize',
delegate: '#settingsView'
}


It seems that I always miss this event.
If I manually delete the "delegate: ..." line the event is catched.

This is rather annoying. Am I doing something wrong here?