16 Apr 2011 9:33 AM #1
xtypes and Ext.require
Well, there are the xtypes which are IMHO a good way to define your component tree (as they are created on demand).
But I cannot understand why the built-in ExtJS widgets are registered to the Ext.Loader. It would be good if there's a registration for xtypes like
Ext.registerClassForXType ('grid', 'Ext.grid.Panel');
So, if an xtype isn't found and Ext.Loader is activated the class will be loaded first. The standard widgets should be registered by default.
It seems that Ext.ClassManager.instantiateByAlias does this. It's not used internally I think. Why?
P.S.: Same problem exists with layouts as "layout:'border'" does not work without an Ext.require.
16 Apr 2011 11:32 PM #2
Use Ext.ClassManger.setAlias, i.e
Ext.ClassManager.setAlias('My.awesome.Widget', 'mine'); // Then later on in your application's code var mine = Ext.create('mine'); // Will automatically load 'My.awesome.Widget' if it doesn't exist yetSencha Touch Lead Architect
17 Apr 2011 1:52 PM #3
Ehm, yes, but why isn't it used for ExtJS base widgets, i.e. form elements?
By noamway in forum Community DiscussionReplies: 65Last Post: 4 Aug 2012, 11:19 PM
By slmbakop in forum Ext: DiscussionReplies: 0Last Post: 9 Mar 2011, 7:13 AM
By stevanovich in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 17 Oct 2008, 5:27 AM
By email@example.com in forum Ext 2.x: BugsReplies: 10Last Post: 15 Oct 2007, 1:59 PM
By jbowman in forum Community DiscussionReplies: 0Last Post: 8 Dec 2006, 4:15 PM