-
23 Nov 2011 1:55 PM #1
Correct way to obtain component references?
Correct way to obtain component references?
When using Designer 1.2.2-48 exported code, which unfortunately doesn't adhere to the new MVC standards, what is the correct way to obtain references to components?
e.g. for the following code (view, not the ui) there are no getters created for the refs or stores:
What is the correct way to get a reference to the viewport INSTANCE (or the gridpanel within the viewport) when not using the MVC code with the controllers, etc... as specified here:Code:Ext.define('LaunchEventWindow.view.MyViewport', { extend: 'LaunchEventWindow.view.ui.MyViewport', refs: [{ // A component query selector: 'viewport > gridpanel', ref: 'lewGridPanel' }], stores: ['LaunchEvents'], initComponent: function() { var me = this; me.callParent(arguments); var myStore = getLaunchEventsStore(); //FAILS, does not exist var myPanel = getLewGridPanel(); //FAILS, does not exist console.debug(myPanel.getId()); } });
http://docs.sencha.com/ext-js/4-0/#!/guide/mvc_pt3Last edited by daubman; 23 Nov 2011 at 1:58 PM. Reason: cleaning up code formatting
-
27 Nov 2011 8:17 PM #2
store lookup
store lookup
Try this...
PHP Code:Ext.StoreMgr.lookup("lewGridPanel");
Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...
When in doubt, check the d4mn source code!
-
27 Nov 2011 8:20 PM #3
Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...
When in doubt, check the d4mn source code!


Reply With Quote
