Hybrid View
-
9 Jan 2012 4:16 PM #1
Control function configuration not triggering event SHOW for listview.
Control function configuration not triggering event SHOW for listview.
REQUIRED INFORMATION
Ext version tested:
Browser versions tested against:
- Chrome (Windows7)
- iPad (iOS 5)
Description:
- control is not working for list show.
- Panel (fit)
- Textfield (docked top)
- list (fit)
- code for control query below.
The result that was expected:
- show event should trigger function
The result that occurs instead:
- nothing
Test Case:
http://visits.benint.net/visits/touch-control/index.html
Code:this.control({ 'autocomplete #list': { refresh: this.onListRefresh, /* works */ show: this.onListShow /* does NOT work */ } });
HELPFUL INFORMATION
See this URL for live test case: http://visits.benint.net/visits/touc...rol/index.html
Operating System:
- Windows 7
- iOS 5
-
10 Jan 2012 6:04 AM #2
How can I look at what control events are active?
Not sure how to debug this.
-
10 Jan 2012 7:34 AM #3
Looks like it works occasionally. Need to check timing?
-
10 Jan 2012 1:58 PM #4
CURRENTLY
Looking at the controller controls...
Calls the application control functionCode:myA.control function (selectors, listeners) { this.application.control(selectors, listeners, this); }
Which in turn calls the event dispatcher doAddListenerCode:myA.application.control function (selectors, listeners, controller) { var dispatcher = this.getEventDispatcher(), selector, eventName, listener; for (selector in selectors) { if (selectors.hasOwnProperty(selector)) { listeners = selectors[selector]; for (eventName in listeners) { if (listeners.hasOwnProperty(eventName)) { listener = listeners[eventName]; dispatcher.addListener('component', selector, eventName, listener, controller); } } } } }
So it is possible, if the format were more dynamic, that we could pass options on to the listener.Code:myA.getEventDispatcher function () { if (!this.eventDispatcher) { this.eventDispatcher = Ext.event.Dispatcher.getInstance(); this.getEventDispatcher = this.getOptimizedEventDispatcher; } return this.eventDispatcher; } var myD = myA.getEventDispatcher() undefined myD.addListener function (targetType, target, eventName) { var publishers = this.getActivePublishers(targetType, eventName), ln = publishers.length, i; if (ln > 0) { for (i = 0; i < ln; i++) { publishers[i].subscribe(target, eventName); } } return this.doAddListener.apply(this, arguments); } myD.doAddListener function (targetType, target, eventName, fn, scope, options, order) { var listenerStack = this.getListenerStack(targetType, target, eventName, true); return listenerStack.add(fn, scope, options, order); }
It would me updating ...application.control to accept a more dynamic input.
Maybe something like..
ORCode:// Example of what I would like to be able to do.... this.control( { "ben_cnt_visit": { activate: this.onVisitActivate, show: this.onShow, buffer: 500 }, "ben_cnt_visit2": { activate: this.onVisitActivate2, show: this.onShow2, buffer: 1000 }, ... });
.Code:// Example of what I would like to be able to do.... this.control( { "ben_cnt_visit": [ { event: 'activate', fn: this.onVisitActivate, buffer: 500, scope: ..., ... }, { event: 'show', fn: this.onShow, buffer: 1000, scope: ..., ... } ], "ben_cnt_visit": [ { event: 'activate', fn: this.onVisitActivate2, buffer: 1500, scope: ..., ... }, { event: 'show', fn: this.onShow2, buffer: 2000, scope: ..., ... } ], });
-
11 Jan 2012 10:29 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
We'll look into this. However it would be much more helpful if you could help providing us a much more simplified test case.
Sencha Touch Lead Architect
-
21 Jan 2012 2:38 PM #6
I think the problem you are having is you have a listener for the 'show' event on your list, but you are actually hiding/showing a container of the list, not the list itself. You can get around this by using the 'painted' event instead.
If not, I cannot reproduce this in the latest code. Please create a smaller testcase and I'll look into it for you.
Thanks!Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.



Reply With Quote