-
3 Apr 2012 9:34 AM #1
Global keypress
Global keypress
Using Designer 2, what is the best way to listen for a keypress event for the entire app? Can I add a keypress listener to the main panel? Or listen for keypress DOM events?
-
3 Apr 2012 10:44 AM #2
Probably subscribing to the key event on the body.
eg
Ext.getBody().on
You could set this up in your Application launch method.Aaron Conran
@aconran
Sencha Architect Development Team
-
3 Apr 2012 1:20 PM #3
Should this fire the alert?
launch: function() {
alert("launched");
Ext.create('MyApp.view.main_panel', {fullscreen: true});
}
The app loads but the alert does not fire.
build 355
sencha touch project
-
3 Apr 2012 3:52 PM #4
It should. I just tested a simple application by doing the following:
Start a touch 2.0 project
Drag out a Panel
Add a launch method to Application
add an alert to the launch method
Save and preview the project in the browser.
the code generated for Application was:
Code:Ext.Loader.setConfig({ enabled: true }); Ext.application({ views: [ 'MyPanel' ], name: 'MyApp', launch: function() { alert('launch'); Ext.create('MyApp.view.MyPanel', {fullscreen: true}); } });Aaron Conran
@aconran
Sencha Architect Development Team


Reply With Quote