了解jqGrid的列宽行为行为、jqGrid

由网友(该用户已饿死)分享简介:我有一棵树网格多列,全部用指定的宽度。和男孩,它看起来很可怕,因为头是用下面列同步的,即使我有短的数据在其中。I have a tree grid with many columns, all with specified width. And boy, it looks terrible since headers...

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

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.

阅读全文

相关推荐

最新文章