如何使jqGrid流体高度?
很长一段时间我都在寻找如何在jqGrid中制作流体高度的答案,但我仍然没有找到。
所以,我需要流体高度。
我知道如何制作流体宽度:
jQuery(window).resize(function(){
gridId = "grid";
gridParentWidth = $('#gbox_' + gridId).parent().width();
$('#' + gridId).jqGrid('setGridWidth',gridParentWidth);
})
我尝试过
gridParentHeight = $('#gbox_' + gridId).parent().height();
$('#' + gridId).jqGrid('setGridHeight',gridParentHeight);
,但不起作用。
有解决办法吗?
For a long time I am looking for an answer to how to make the fluid height in jqGrid, but I still have not found it.
So, I need fluid height.
I know how to make fluid width:
jQuery(window).resize(function(){
gridId = "grid";
gridParentWidth = $('#gbox_' + gridId).parent().width();
$('#' + gridId).jqGrid('setGridWidth',gridParentWidth);
})
I tried with
gridParentHeight = $('#gbox_' + gridId).parent().height();
$('#' + gridId).jqGrid('setGridHeight',gridParentHeight);
but that is not working.
Is there a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决我的问题的方法。这是代码(在 Firefox 中工作):
I found a solution for my problem. Here is the code (works in Firefox):
我很欣赏这是一个旧线程 - 但这里有一个 CSS(因此更流畅)解决方案。
实际操作示例: http://jsfiddle.net/Ba5yK/16/
I appreciate this is an old thread - but here's a CSS (and therefore smoother) solution.
An example of this in action : http://jsfiddle.net/Ba5yK/16/