本人新手,以下仅仅是个人观点:
OPOJ方式下使用Ext,由于在第一次加载时,加载了太多了js,导致加载时间过长。
加速加载js库大概有如下几个方法(非网络因素):
1、硬件:用更好的cpu,更高的内存
2、软件:使用对ext支持更好的os和浏览器
3、各个浏览器窗口共享js对象而不是js文件
4、实现单页面按需加载js
方法1、2都不是开发者所直接能控制的。
目前来说对于子页面不能共享父页面的ext库,虽然一般他们用的js文件是相同的。
所以目前来说方法3可能行不通。
传统web方式下,各个页面使用自己的js(量比较少)。
由于ext库本身巨大(不是代码量,应该是对象数和对象的复杂程度),使用单页面的好处也很明显(不是单js,通常单js是为了网络传输,但是对于传输后浏览器加载来说,几乎没有区别)。
同时我们一般用tab来划分业务,目前部分ext users使用tab+iframe来实现多页面的应用。这样就可以将各个业务使用的非通用的js区别来,各自在使用时加载到独立的页面,其实还是传统的方式。
考虑到目前已经有很多js库使用按需加载的方式来管理js文件和对象。可以从这个方面出来,利用方法4来实现大型js库的提速。由于本人能力有限,只是想法而已。
最后,提供一个有点关系的extend:总的来说,就是通过一个url来动态的加载所需的js脚本来创建js组件。
大家可以直接看例子。个人觉得还是太粗糙,期盼牛人们实现一个功能更完善,设计更好的extend。这样,ext向前发展的轮子应该可以走的更远、应用范围也会更广。
http://extjs.com/forum/showthread.php?t=18023
-------------------
ExtJS - Plugin - RemoteComponent / LiteRemoteComponent - Demo
Plugin for ExtJS Ext.Container / Ext.Toolbar Elements to dynamically add Components
from a remote / AJAX source to the Element's body.
author: Timo Michna / matikom
* Loads configuration as JSON-String from a remote / AJAX source.
* Adds the Components to the Container body.
* Additionally to its own config options the class accepts all the configuration options
required to configure its internal Ext.Ajax.request().
* The RemoteComponent consists of the lightweight Ext.ux.Plugin.LiteRemoteComponent class and
the more configurable Ext.ux.Plugin.RemoteComponent which extends Ext.util.Observable.
Ext.ux.Plugin.RemoteComponent:
* Several events, which can be used to stop further processing by returning false.
* Processing can also be stopped by config option breakOn at any of the plugins events.
* AJAX requests to the remote source can be defered by config option loadOn to any event of the container. Usefull for lazy loading etc.
* LiteRemoteComponent and RemoteComponent - Plugins can be nested. So a Plugin can load and create Components, which also have (a) RemoteComponent - Plugin(s)
Where to use:
You can use the plugin with any Component with
plugin ability - this is Ext.Container, Ext.Toolbar
and every Component derived from both of them.
For example: TabPanel, Tip, Window, FieldSet, FormPanel,
GridPanel, TreePanel, PagingToolbar, etc.
What to use for?
This is a very small but powerfull plugin. use it for:
- lazy loading of components
- provide different views of components per request
- remote Forms
- cascade component views based on server side authentification
- testing of component configuration. Don´t reload the document,
destroy and reopen a component with a RemoteComponent plugin.
- and many more
分享到:
相关推荐
Ext4 动态加载js例子 Ext4 动态加载js例子 Ext4 动态加载js例子 Ext4 动态加载js例子
Ext的gridpanel控件二次加载时丢失解决方案
Ext.ux.tree.treegrid异步加载,点击节点加载数据
Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载Ext-tree加载
这是一个用于EXT实现复杂表头的插件.资源共享...欢迎下载.
无法加载安装程序库fp40ext.dll
EXT4.0项目源码
Ext实例项目 Ext实例项目 Ext实例项目 Ext实例项目 Ext实例项目
ext4.0动态加载,使用json数据源,整个项目只有一个页面,js按照mvc模式搭建
ext项目实例源码
Ext3.4.0复杂(多行)表头+锁定多列例子 非常棒,项目中需要使用到的。
这是一个简单实用的Ext项目,里面涵盖了Ext的树形菜单,Ext与服务器的交互以及服务器返回客户端一个树形菜单的实现,还有Ext可以编辑的表格的制作代码等等,很有用哦!
NULL 博文链接:https://sungoshine.iteye.com/blog/1154539
1、Ext版本:3.2.1; 2、运行环境:VS 2008 以上; 3、远程加载数据,数据在程序中生成,无需连接数据库或XML文件; 4、运用Viewport管理页面布局 5、GridPanel的各种功能和特效
Ext项目Demo集合,包括Ext的布局,Ext的form示例,Ext的文件上传功能,你值得拥有
我博文 Ext下多tab的延迟加载问题.docx 文章里的原文。
用ext + xml文件 完成 ext tree panel 树结构。延迟加载,支持 多选 单选。前后台数据交互使用的是 json串,挺不错的
使用 json 动态加载 Ext 表单数据。
点击添加/删除windows组件时,报错:无法加载安装程序库iis.dll,或是找不到函数OcEntry。...C:\Windows\System32\中缺少四个dll文件: iis.dll setupqry.dll imsinsnt.dll fp40ext.dll 下载后复制到目录下就好了。
ext.net 中树加载及实现方式,初学者可以参考,项目中一段代码片段,仅供参考