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

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

问题描述

jqGrid 包含带有很多行的文本区域.在这种情况下,编辑和查看窗口高度太大.这些窗口呈现在屏幕外,底部行不可见.

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.

如何限制这些窗口高度,以便它们始终适合屏幕和强制滚动条出现在 nessecary 中?

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

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

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天全站免登陆