jqGrid和自动宽度选项.它是如何工作的? [英] jqGrid and the autowidth option. How does it work?

查看:99
本文介绍了jqGrid和自动宽度选项.它是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用autowidth选项设置为true的jqGrid.

I am using jqGrid with the autowidth option set to true.

根据文档:

设置为true时,网格宽度将自动重新计算为父元素的宽度.仅在创建网格时才执行此操作.为了在父元素更改宽度时调整网格大小,您应该应用自定义代码并为此使用setGridWidth方法

When set to true, the grid width is recalculated automatically to the width of the parent element. This is done only initially when the grid is created. In order to resize the grid when the parent element changes width you should apply custom code and use a setGridWidth method for this purpose

这使栅格占据了父元素中所有可用的宽度. 此属性的另一个效果是,每列都会缩小以适合可用的宽度.

This makes the grid occupy all the width available in the parent element. Another effect of this property is that every column shrinks to fit the width available.

这很好.但是,我有一页不希望列缩小以适合网格宽度,但是它们应该占据我在colModel中为其设置的空间.

This works very well. However, I have one page where don't want the columns to shrink to fit the grid width, but they should occupy the space that I set within the colModel for them.

我该如何实现?

推荐答案

解决方案:shrinkToFit: false

这篇关于jqGrid和自动宽度选项.它是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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