问题描述
我是jqgrid的新手,我想增加jqgrid的宽度.我增加了列宽,但网格宽度没有增加.我正在使用php jqgrid.
I am new in jqgrid and I would like to increase the width of jqgrid.I have increased the column width but the grid width is not increasing.I am using php jqgrid.
是否有任何参数可以传递此功能:=
Is there any parameters to pass this function :=
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
或者我该怎么做?
非常感谢.
推荐答案
您的问题主要是关于jqGrid的商业版本,我不知道.主要问题也存在于jqGrid中. jqGrid具有 width 参数,可用于定义网格宽度.我想您应该使用(或已经使用)$grid->setGridOptions
来定义选项.可以额外使用的另一个选项是autowidth
,它将覆盖根据网格父级的大小计算出的width
值.其他重要选项可能对您很重要:shrinkToFit
,其默认值为true
.这意味着该列的width
属性将不用作像素的确切列宽.取而代之的是,width
属性将仅用于定义列宽之间的比例.如果某些列的列宽不应更改,则应在colModel
中包含fixed: true
属性,以用于该列的相应定义.如果要为所有列都具有精确的列宽(如colModel
的项的width
属性中所定义),则应使用jqGrid设置shrinkToFit: false
.尝试将设置包括在$grid->setGridOptions
调用中.
You question is mostly about the commercial version of jqGrid, which I don't know. The main problem exist also in the jqGrid too. jqGrid has width parameter which can be used to define the grid width. I suppose that you should use (or already use) $grid->setGridOptions
to define the option. Another option which can be additionally used are autowidth
which will be overwrite the width
value calculated based on the size of the grid's parent. Other important option can be important you: shrinkToFit
which default value is true
. It meant that the width
properties for the column will be not used as the exact column width in pixel. Instead of that the width
properties will be used to define only proportion between the column widths. If the column width of some column should be not changed you should include fixed: true
property in the colModel
for the corresponding definition of the column. If you want to have exact column width for all columns (as it's defined in width
properties of the items of the colModel
) you should use the jqGrid setting shrinkToFit: false
. Try to include the setting in the $grid->setGridOptions
call.
这篇关于增加jqgrid表的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!