In our previous example, a new line was added to the bottom of each class file:
Ext.reg('userdetail',CRM.panels.UserDetail);
What we've done here is register our new custom component as an xtype
. Well, what does that mean exactly? An xtype
is a component container element, registered with the Ext JS library, for lazy object instantiation. What this means is that we can use the xtype
as a quick object identifier, when laying out our applications, and that these types of objects are only loaded into browser memory when they are actually used. This can greatly improve the overall performance of our application, especially when a view may contain many objects. We'll use xtype
wherever possible while writing object configuration, so that objects that might not immediately be displayed won't take up valuable memory resources. Next, we'll look at this in practice.