-
4 Mar 2012 8:09 PM #1
Adding to application launch event
Adding to application launch event
In sencha designer 2, how can i add code to the application launch function?? Is this only possible by editing the JS files that get generated directly? If i edit the generated JS files, will sencha designer 2 be aware of and pick up those changes when i open it again or simply over-write them?
Thanks,
Shane
-
4 Mar 2012 8:11 PM #2
Sorry, i found it on the top left drop down in the code window..
-
5 Mar 2012 5:25 AM #3
-
5 Apr 2012 5:29 AM #4
Where did this go? I could not find a way to get add items to application launch in build 360.
-
5 Apr 2012 8:48 AM #5
Click on the Application node, in the bottom right property grid you'll see launch with a plus icon next to it. Click the plus icon and it will add a launch function.
Aaron Conran
@aconran
Sencha Architect Development Team
-
5 Apr 2012 10:59 AM #6
Thanks! I cannot keep track of what gets moved. Not complaining, just trying to keep up! I'm sure I'll get the hang of the system soon and be able to guess where to look.
Keep up the good work.
Worth
-
11 Apr 2012 6:33 AM #7
I'm new to designer and ExtJS. Why does the previous version create a runnable version of a project without adding any manual code but this new version only adds an empty launch function? Or is that still in process?
-
11 Apr 2012 8:51 AM #8
-
11 Apr 2012 9:42 AM #9
I just created a very simple project with a window which contains a container which contains a button. Everything is designer defaults.
I then selected the application node, clicked on the + next to launch and the center content window changed to an empty launch function.
Here is the code it generated (with comments removed and the full paths added for each file). I didn't edit any code. I'm sure I'm doing something wrong but I'm not sure what.
Code:// PrjRoot/app/view/Viewport.js // Ext.define('MyApp.view.Viewport', { extend: 'MyApp.view.MyWindow', renderTo: Ext.getBody(), requires: [ 'MyApp.view.MyWindow' ] }); // PrjRoot/app/view/MyWindow.js // Ext.define('MyApp.view.MyWindow', { extend: 'Ext.window.Window', height: 250, width: 400, title: 'My Window', initComponent: function() { var me = this; Ext.applyIf(me, { items: [ { xtype: 'container', items: [ { xtype: 'button', text: 'MyButton' } ] } ] }); me.callParent(arguments); } }); // PrjRoot/app.js // Ext.Loader.setConfig({ enabled: true }); Ext.application({ views: [ 'MyWindow' ], autoCreateViewport: true, name: 'MyApp', launch: function() { } }); // PrjRoot/app.html // <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>testprj4</title> <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-4.0.2a/resources/css/ext-all.css"/> <script type="text/javascript" src="http://extjs.cachefly.net/ext-4.0.2a/ext-all-debug.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body></body> </html>
-
11 Apr 2012 10:28 AM #10
Did you want something in the launch function?
Because you have set the Window as the initial view it will be created when the application launches. Windows don't show by default though. You probably want to turn on the autoShow configuration on the Window.Aaron Conran
@aconran
Sencha Architect Development Team


Reply With Quote