View Full Version : [CLOSED] Can't customize events in controller control block due to error

15 May 2012, 7:13 AM

Touch 2-1.0.0
Browser versions tested against:

Safari 4

When wanting to add a listener to a controllers ref in the 'control' block with custom properties like 'Buffer' or 'Scope' the Sencha framework errors.
Steps to reproduce the problem:

Have a controller and a reference to a Component
Instantiate a listener following the examples in the http://docs.sencha.com/touch/2-0/#!/guide/events-section-6

TypeError: 'undefined' is not a function (evaluating 'firingFn.apply(scope, args)')sencha-touch-all-debug.js:17418 (file:///Users/KempenHills/Documents/App/KTS/App/iOS/KTS/www/js/sencha-touch-all-debug.js)
The result that was expected:

The event to be defining/created (don't know if the error occurs on firing the event or on defining)
The result that occurs instead:

Errors on line 17418
Test Case:
can't give more than this sorry :) company secrets!
overview_times: 'selectfield[name="ticket_overview_showtime"]'

overview_times: { change: {
fn:function(select, newValue, oldValue, eOpts) {
buffer: 300,
HELPFUL INFORMATIONHave tried this before in other apps and failed the same way.Screenshot or Video:

See this URL for live test case: http://Debugging already done:

Possible fix:

not provided
Additional CSS used:

only default ext-all.css
Operating System:

Mac OSX 10.7.3

16 May 2012, 4:28 AM
This is not currently supported. We have talked about this and will decide whether or not to implement.

18 May 2012, 12:18 AM
I love Sencha to work with, but these kind of inconsistencies across the framework keep being a pain in the butt :( if i can define a customized listener in the define block in my view (which is discouraged, please get the docs straightened out soon.. ) why can't i do it in my controller where the listener is supposed to be ??

How am i supposed to customize events in my controller, is there an override available?
My apps consist of view/store/model defines and controller ref/control blocks... what if i want to customize the initialize event f.e.? impossible atm?

or in MY example, where the selectfield fires the event 2x (bug across multiple apps of mine... assigned a store, reference it in my controller and the change event fires TWICE) where its performance killing to let the same handler execute 2 times with some performance heavy code behind it including calls to the server... i guess using on and un to keep adding and removing the listener every time its initialized / destroyed? that would kill the whole idea of control block wouldn't it :P

18 May 2012, 4:34 AM
You would need to listen to them in your view and fire a custom event.