根据行数调整jqGrid的大小? -网格高度? [英] Resize jqGrid based on number of rows? - Grid height?

查看:152
本文介绍了根据行数调整jqGrid的大小? -网格高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与帖子根据行数调整jqGrid的大小相同的问题?

某些建议(似乎完全合乎逻辑)不起作用,因为当我尝试使用var height = $("#TableId").height();来获取网格的高度时,它会返回设置网格时设置的值,即"100%" ...

Some of the suggestions (which seem totally logical) do not work because when I try to get the height of the grid using var height = $("#TableId").height(); it returns what was set when setting up the grid, i.e. "100%"...

如何获取以像素为单位的高度?

推荐答案

在您之前的实验中,这是错误的.从演示

It was something wrong in your previous experiments. How you can see from the demo the jQuery.height method get you the height of the grid in pixel if you use height:'100%' or height:'auto' in the jqGrid definition.

如果想知道整个网格高度(包括捕获,标题,寻呼机等),应该得到$("#gbox_TableId").height()而不是$("#TableId").height()的高位.

By the way if you want to know the full grid height including the capture, headers, pager and so on you should get hight of $("#gbox_TableId").height() instead of $("#TableId").height().

这篇关于根据行数调整jqGrid的大小? -网格高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆