JQGRID 列 header 的自动宽度和基于大小的列值

JQGRID autowidth of column header and column value based on size

我是 JQGRID 新手。我有一个网格。我希望列宽应等于列标题网格的最大值,以较大者为准。

不完全清楚您的意思以及您使用的是哪个 version/fork jqGrid。 Free jqGrid is the fork which I develop. It contains the feature for automatic resizing of columns on double-click between the column headers or direct by loading. See the wiki article 了解更多信息。

如果我正确理解你的问题,那么你应该添加 cmTemplate: { autoResizable: true } 选项以在每一列中设置 autoResizable: true 属性 并添加 autoresizeOnLoad: true 选项 jqGrid 以自动调整所有大小加载数据后的列。