如何限制jqGrid编辑和查看窗口的最大高度 [英] How to restrict max height of jqGrid edit and view windows

查看:59
本文介绍了如何限制jqGrid编辑和查看窗口的最大高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jqGrid包含具有很多行的textarea. 在这种情况下,编辑和查看"窗口的高度太大.这些窗口在屏幕外渲染,底部的行不可见.

jqGrid contains textareas with lot of lines. Edit and view window height is too big in this case . Those windows are rendered out of screen, bottom rows are not visible.

如何限制这些窗口的高度,以使其始终适合屏幕并强制使用 滚动条出现在必要的地方吗?

How to restrict those window heights so that they always fit to screen and force scrollbars to appear in nessecary ?

我发现的答案限制了文本区域的高度,但我正在寻找一种限制整个窗口高度的方法,并在必要时强制在窗口中显示滚动条.

Answers which I found restrict textarea height but I'm looking for a way to restrict whole window height and force scrollbars in while window to appear if nessecary.

我尝试过

jQuery.extend(jQuery.jgrid.edit, {
  maxheight: 0.82* screen.height,
  dataheight: height-60
  } );

jQuery.extend(jQuery.jgrid.view, {
  maxheight: 0.82* screen.height,
  dataheight: height-60
  } );

但这并不限制最大高度.

but this does not restrict max height.

推荐答案

在我看来,在表单上设置"max-height"应该可以解决问题:

It seems to me that setting of "max-height" on the form should solve the problem:

beforeShowForm: function ($form) {
    $form.css({"max-height": 0.70*screen.height+"px"});
}

请参见演示.因为我没有太多的'textarea'类型的列,所以我只是将一列的高度设置为较大的值,以验证所需的表格的最大高度.我无法测试小型编辑表单的高度,但是视图表单的高度与设置无关.

See the demo. Because I don't have so many columns of the type 'textarea' I just set the height of one column to large value to verify the max-height of form, which you need. In the way I can't test the height of small edit form, but the height of view form independent on the setting.

这篇关于如何限制jqGrid编辑和查看窗口的最大高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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