-
5 Nov 2011 6:03 AM #1
LIsten map events inside a controller
LIsten map events inside a controller
Hello, I can't be able to listen for the maprender event using the control() method inside a controller. It works for other events but not for the maprender. On the other side, if I listen for the event in the map object itself it works.
This is the code that doesn't work:
Im using chrome to testing with Sencha Touch 2.0.0 Preview Release 1Code:Ext.define('Test.controller.MainController', { extend: 'Ext.app.Controller', init: function() { console.log('init controller'); this.control({ 'map': { maprender: function() { console.log('the map render'); } } }); } }); Ext.application({ name: 'Test', controllers: ['MainController'], launch: function() { Ext.create('Ext.Container', { layout: 'card', fullscreen: true, items: [{ xtype: 'map', }] }); } });
Anybody have the same issue?
Greetings.
-
5 Nov 2011 8:47 PM #2
This is a bug with the Map component. The maprender event gets called when the component is constructed, which is incorrect. This also means that it gets called immediately, which is too late for the .control method in your controller.
-
6 Nov 2011 5:03 AM #3
Ok, by now I can get it working using the activate event instead.
-
29 Nov 2011 12:00 PM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
This issue has been resolved for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-983
in
2.0.


Reply With Quote