如何处理 Ext GWT (GXT) 中小部件渲染缓慢的问题?
我有一个窗口,里面有几个小部件。渲染后,它会在左上角显示一秒钟,然后居中。
有没有机会延迟渲染?我的意思是窗口首先居中,然后渲染子窗口小部件。 或者也许我可以在渲染过程中将窗口内容隐藏在蒙版后面?
I have window with few widgets inside. When it is rendered, it shows in top left corner for a second and then is centered.
Is there any chance to lazy rendering? I mean that window is centered first and then child widgets are rendered.
Or maybe I can hide window content behind mask during it is rendered?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DeferredCommand
可能可以通过等待所有当前事件得到处理来帮助解决这种情况 - 这样,当需要渲染框时,浏览器的负载可能会减少。您可以通过使用众多技巧之一(例如
overflow:hidden; text-indent:-9000px;visibility:visible;
)首先在客户区域之外显示框来“模拟”延迟渲染然后删除该样式 - 该框应该自动出现在客户区域的中心。DeferredCommand
might help the situation a bit, by waiting for all the current events to be handled - that way when it's time to render the box, the browser might be less loaded.You could 'emulate' lazy renedering by showing the box first outside the client area using one of the many tricks for that (like
overflow:hidden; text-indent:-9000px; visibility:visible;
) and then removing that style - the box should automagically appear at the center of the client area.我曾经处理过在表单中动态加载多个 GXT 小部件的情况。
在我的研究结束时,我确定 ExtJS 小部件渲染速度很慢,因此从 GXT 中你没有太多选择。
我最终使用了标准的 GWT 小部件,它的渲染速度要快得多。
您没有提供有关您情况的详细信息,因此我无法说隐藏某些小部件内容的技巧是否适合您的用例。
I've dealt with a situation where I was loading several GXT widgets in a form dynamically.
At the end of my research, I determined ExtJS widgets render slowly, so from GXT you don't have many options.
I ended up using standard GWT widgets, which render much more quickly.
You didn't give a lot of detail about your situation so I can't say whether a trick hiding some widget content will work for your use case.