PDA

View Full Version : Dynamic Loading?



mdavis6890
24 Feb 2011, 6:51 PM
I'm currently using bootstrap.js which loads ext-debug-all. I'd like to instead try out the dynamic loading feature. Can somebody point me in the right direction?

Jacky Nguyen
24 Feb 2011, 9:56 PM
We're in the midst of preparing a thorough guide on this. There are important information and best practices to take note in order to avoid any downside of this approach, so I strongly suggest that you wait for a little while more. The tutorial should be out soon before the final release of Ext 4.

mdavis6890
25 Feb 2011, 7:30 AM
In that case, can you help me understand this error message that cropped up when I moved to pr2?

[Ext.Loader][not enabled] Missing required class: gridpanel

From:



4505 // If the dynamic dependency feature is not being used, throw an error
4506 // if the dependencies are not defined
4507 if (!this.config.enabled) {
4508 if (classNames.length > 0) {
4509 throw new Error("[Ext.Loader][not enabled] Missing required class" + ((classNames.length > 1) ? "es" : "") +
4510 ": " + classNames.join(', '));
4511 }
4512 }


Everything still seems to work, but I'd like to identify the problem and fix it.

Thanks,
Michael

Jacky Nguyen
25 Feb 2011, 10:15 AM
It looks like you have a typo in the class name you're trying to instantiate ('gridpanel'). This won't work:



Ext.create('gridpanel'); // 'gridpanel' is neither a valid class name nor a valid alias


It should be either one of these instead:



new Ext.grid.GridPanel;

Ext.create('Ext.grid.GridPanel'); // By full class name

Ext.create('widget.gridpanel'); // By alias

Ext.widget('gridpanel'); // By xtype, recommended

mdavis6890
27 Feb 2011, 11:38 AM
The source of the problem was some Ext.extends that I was still using. I guess something changed between pr1 and pr2 to alert/break on this legacy code. I changed those to Ext.define and the errors stopped.

Michael