简体   繁体   English

jqGrid的。 第一次单击列跨度调整器会将列宽设置为默认计算

[英]jqGrid. First single click on column span-resizer sets column width to default calculated

I have an issue when I'm clicking first time to column's span-resizer --> column width returns to some default calculated value. 我第一次单击列的span-resizer时遇到问题->列宽返回到一些默认的计算值。 The same thing appears when I'm trying to resize it: it resizes not from current width, but from that calculated! 当我尝试调整大小时,会出现相同的内容:它不是根据当前宽度进行调整,而是根据计算得出的宽度进行调整!

This shows my table after page load: columns' width are good. 这显示了页面加载后的表格:列的宽度很好。 screenshot after page load 页面加载后的屏幕截图

But after clicking to resize State column --> it's just returns to some value (in that case screenshot after click on column resize 但是在单击以调整State列的大小后->它只是返回到某个值(在这种情况下,单击列调整大小后的屏幕截图

How can I fix this issue? 如何解决此问题?

PS Sorry, I have no enough rep to add images. 抱歉,我没有足够的代表来添加图像。

jqGrid hold column header and the column data in separate dives. jqGrid分别保存列标题和列数据。 So jqGrid have to hold scroll position of the header div (hDiv) the same as the scroll position of the div with the grid body (bDiv). 因此,jqGrid必须将标头div(hDiv)的滚动位置与网格主体(bDiv)的div的滚动位置保持相同。 I think that jqGrid have a bug in your situation. 我认为jqGrid在您遇到的情况中存在错误。 As the workaround you can use resizeStop where one set the scroll position of hDiv to the current scroll position of bDiv: 作为解决方法,您可以使用resizeStop ,其中将resizeStop的滚动位置设置为bDiv的当前滚动位置:

resizeStop: function () {
    this.grid.hDiv.scrollLeft = this.grid.bDiv.scrollLeft;
}

I think that it should solve the problem. 我认为这应该解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM