-
14 Feb 2013 7:55 AM #1
[4.2.0.489] cmp not available at plugin constructor
[4.2.0.489] cmp not available at plugin constructor
Great to see a RC ! thanks
There is a problem with plugin instantiation. We use to have a ref to cmp initiating the plugin during construction - it is not the case anymore.
We could have, instead of the original code below:
to make it work againCode:if (plugin.ptype && !plugin.isPlugin) { // If a config object with a ptype plugin = Ext.PluginManager.create(plugin, null, this); } else if (typeof plugin == 'string') { // ptype only plugin = Ext.PluginManager.create({ ptype: plugin }, null, this); }
in AbstractCmp :
C.Code:constructPlugin: function(plugin) { if (plugin.ptype && !plugin.isPlugin) { // If a config object with a ptype plugin = Ext.PluginManager.create(plugin); } else if (typeof plugin == 'string') { // ptype only plugin = Ext.PluginManager.create({ ptype: plugin }); } if (plugin.cmp !== this) { if (plugin.setCmp) { plugin.setCmp(this); } else { plugin.cmp = this; } } return plugin; },
-
14 Feb 2013 10:56 AM #2
@christophe.geiser -
The problem this was trying to solve is that the plugin author cannot really know in all cases how the plugin will be created. In this case, for example, if the plugin is created and passed as a plugin to the component.
To handle other forms of construction for plugins, we shifted all of our plugins to use setCmp as the earliest moment where the plugin meets the component... since we could not change the timing of the init method this seemed the safest.
That said, and since at times the plugin author and user are one and the same
- I think we can restore the cmp reference at construction time for *some* forms of plugin construction.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
You found a bug! We've classified it as
EXTJSIV-8669
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote