了解jqGrid的列宽行为 [英] Understanding JQGrid column width behaviors

查看:163
本文介绍了了解jqGrid的列宽行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一棵树网格多列,全部用指定的宽度。和男孩,它看起来很可怕,因为头是用下面列同步的,即使我有短的数据在其中。

I have a tree grid with many columns, all with specified width. And boy, it looks terrible since headers are out of sync with columns below, even if I have short data in them.

具体地说,如果列标题标题为的比这列的宽度,头部向下收缩到在报头中的文字的大小。

Specifically, if the column heading title is shorter than this column width, the header shrinks down to the the size of the text in the header.

我怎样才能让头完全一样大小的列?

问题2:我注意到,虽然文件说,列宽度选项是以像素为单位,我可以看到,它实际上不是以像素为单位,而只是相对于其他宽度的网格一个数字。例如。如果所有字段都是大小10,他们都将是大小相等,但不是在宽度为10个像素。

Question 2: I've noticed that although the documentation says that the columns "width" option is in pixels, I can see that it's actually not in pixels, but just a number relative to other widths in grid. E.g. if all fields are size 10, they all will be equal in size, but not 10 pixels in width.

先谢谢您的澄清,因为这简单的问题似乎已经深深扎根比我想象的。

Thanks in advance for clarifications, as this simple issue seems to have deeper roots than I thought.

推荐答案

试着用autowidth'和'shrinkToFitjqGrid的参数发挥。例如,如果'shrinkToFit'是真,列的宽度将被改变,如果初始宽度定义百分比。了解更多这里

Try to play with 'autowidth' and 'shrinkToFit' jqGrid parameters. For example, if 'shrinkToFit' is true, columns' width will be changed as if initial widths defines percentage. Read more here.

这篇关于了解jqGrid的列宽行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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