How to get an application from a view?

How can I get my application from a view? For example, consider that I have a Boo application and have a view named Boo.view.Foo.List , and I want to get Boo in the List view.

Edit:

See this code and look at line 20.

 Ext.define('Boo.view.Foo.List', { extend: 'Ext.panel.Panel', model: 'Boo.model.FooModel', alias: 'widget.foolist', store: 'FooListStore', initComponent: function () { this.columns = [ { text: "Hello world", dataIndex: 'Time', flex: 1 }, { xtype: 'actioncolumn', width: 50, items: [{ icon: 'cancel.png', tooltip: 'Cancel', handler: function (grid, rowIndex, colIndex, col, e) { //Now I need to get the application here, for example with self.getApplication() or something like this. } }] }]; this.callParent(arguments); } }); 
+6
source share
1 answer

You can archive this using appProperty

 Ext.application({ name: 'MyApp', appProperty: 'Current' }); 

Now you can call

 MyApp.Current 

externally call the MyApp namespace within the window (global).

For any version prior to 4.1.3, add the following line to the Launch-Method application

 YourAppName[this.appProperty] = this; 
+10
source

All Articles