如何将“加载数据”居中。 ”。” jqgrid 树形网格中可见屏幕中的消息?
我有一个 jqGrid 树形网格,约有 40 列,因此有一个大的水平滚动条(取决于浏览器的大小)。问题是由于宽度太大,当页面加载或我执行过滤器等时,您看不到弹出窗口“正在加载消息......”因为它位于屏幕右侧。
有什么办法可以让“正在加载数据..”当前可见屏幕中的消息中心(而不是整个页面?
I have a jqGrid treegrid with about 40 columns so there is a large horizontal scroll bar (depending on the size of the browser). The issue is since the width is so large, when the page loads or i do a filter, etc, you don't see the popup "Loading message . ." because its off to the right of the screen.
Is there any way to have the "Loading Data. ." message center in the current visible screen (instead of the page as a whole?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现你的问题问得很好。 jqGrid 的其他用户也可能遇到同样的问题。
我个人更喜欢使用
loadui: 'block'
设置,该设置在网格加载期间显示整个网格上的覆盖。在这种情况下,问题就不会那么重要了。如果您更改 loadBeforeSend 内的“Loading ...”div 的位置,您可以获得更好的结果:
在我看来,最好修改 jqGrid 的基本代码(准确地说是修改 beginReq 函数)以使上述“正在加载...”div 的位置始终发生变化。
更新:更改“Loading ...”div 位置的更好实现可能是
代码应像以前一样放置在
loadBeforeSend
中。更新2:演示演示了主意。我在外部
loadComplate
中添加了代码,仅用于演示目的,以展示其工作原理。在演示中,“正在加载”div 保持可见,并且我还额外显示了使用loadui: 'block'
选项时显示的覆盖层:I find your question is good. The same issue could have other users of jqGrid.
I personally prefer to use
loadui: 'block'
setting which shows the overlay over the whole grid during the grid loading. In the case the problem will be not so important.You can get better results if you change the position of the "Loading ..." div inside of the
loadBeforeSend
:In my opining it would be good to modify the base code of jqGrid (to be exactly to modify the code of beginReq function) to have the described above changing of the position of the "Loading ..." div always.
UPDATED: Probably the better implementation of the changing the position of the "Loading ..." div will be
The code should be placed in the
loadBeforeSend
as before.UPDATED 2: The demo demonstrate the idea. I included the code outside of
loadComplate
only for demonstration purpose to show how it will work. In the demo the "Loading" div stay visible and I show additionally the overlay displayed in case of usage ofloadui: 'block'
option:将加载消息的容器放置在固定位置,顶部和左侧分配到 40%-60% 左右。这会修复
它应该是这样的:
Position the container of the loading message in a fixed position with the top and left assigned to around 40%-60%. That would fix it
It should be something like that :