开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜