When will you use Ext.application () and Ext.Loader.setConfig, .require and .onReady?

I see that some of the examples included in ExtJS 4 are launched with a single call to Ext.application() . However, other examples manually call Ext.Loader.setConfig() , Ext.require() and Ext.onReady() . I want to make sure I understand the difference.

Am I correct in assuming that:

  • Do you usually use the convenient Ext.application() call for full-screen (for example, Viewport-based applications)?

  • if you just want to use several ExtJS components on a pre-existing non-Ext page, would you choose to manually call Ext.Loader , require and onReady() ?

Thanks for the clarification!

+6
source share
1 answer

A full application call is used for the Ext MVC approach and comes with a set of conventions for preloading additional components, such as store parameters and views in the controller classes. For a better explanation, see Ext Documentation on MVC .

If you just need to drop a few components on the page, as you say, you will get better performance simply by using the loader, or, better, avoiding dynamic loading (at least in production).

+8
source

Source: https://habr.com/ru/post/889536/


All Articles