开发者

When would you us Ext.application() vs. Ext.Loader.setConfig, .require, and .onReady?

开发者 https://www.devze.com 2023-03-09 23:06 出处:网络
I see that some of the examples included with ExtJS 4 start up via a single call to Ext.application(). Other examples, however, 开发者_StackOverflow中文版manually call Ext.Loader.setConfig(), Ext.requ

I see that some of the examples included with ExtJS 4 start up via a single call to Ext.application(). Other examples, however, 开发者_StackOverflow中文版manually call Ext.Loader.setConfig(), Ext.require(), and Ext.onReady() instead. I want to make sure I understand the difference.

Am I correct in assuming that:

  1. you'd normally use the convenient Ext.application() call for a full-screen (e.g., Viewport-based) app?

  2. if you just want to use a few ExtJS components on a pre-existing "non-Ext" page you'd opt for the manual calls to Ext.Loader, require, and onReady()?

Thanks for the clarification!


The full application call is used for the Ext MVC approach, and comes with a set of conventions to pre-load additional components, for example the stores and views options in the controller classes. For a better explanation see the Ext documentation on MVC.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消