仅在需要时使用 Ext.onReady 加载 Ext.JS4
目标:
仅在需要时加载 Ext Framework(JS 文件)。
问题:
当在稍后的状态加载 Ext.JS 时,Ext.onReady 不会触发。我尝试围绕 Ext.onReady 进行工作,但也没有成功。我很乐意提供任何见解。我还尝试过除 jQuery 之外的各种加载器。
非工作样本:
http://jsfiddle.net/thomasf1/XNJxT/21
相同的示例,但加载 Ext.JS立即(有效):
http://jsfiddle.net/thomasf1/WvcZu/1/
相同的示例,稍后加载网格,但立即包含 JS(有效):
http://jsfiddle.net/thomasf1/WvcZu/2/
Goal:
Load Ext Framework (JS File) only when needed.
Problem:
When loading Ext.JS at a later state Ext.onReady doesn´t fire. I tried working around Ext.onReady, which I didn´t get to work either. I´d be happy for any insight. I´ve also tried various loaders other than jQuery.
The non-working sample:
http://jsfiddle.net/thomasf1/XNJxT/21
Same example, but loading Ext.JS immediately (works):
http://jsfiddle.net/thomasf1/WvcZu/1/
Same example, later load of grid, but immediate include of JS (works):
http://jsfiddle.net/thomasf1/WvcZu/2/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 Ext 加载器不是为这种事情而设计的。你必须明确告诉 Ext DOM 已经加载:
Looks like the Ext loader is not made for that kind of thing. You're gonna have to tell Ext explicitly that the DOM is already loaded: