当有数百列时,SlickGrid 标题会换行
当我的结果集包含数百列时,标题会回绕到网页的左侧并占据两行。数据中标题位置和列位置之间的相关性在标题单元格第一行末尾也不正确。
看来标题的宽度固定为 10000px,而行单元格的宽度可以更宽,这就是导致渲染问题的原因。
slick-header-columns 的样式由 slick.grid.js 显式设置为: style="width: 10000px; left: -1000px"。
当我在这种包装状态下通过 firebug 检查 css 时,我看到每个光滑行的宽度设置为:12805px。当我手动将 slick-header-columns 宽度更改为 15000px 时,渲染正确并且标题不再换行。
有没有办法以编程方式更新标题宽度,以便它可以容纳所有列单元格?
When I have a result set with several hundred columns, the header wraps back to the left side of the web page and takes up two rows. The correlation between header positions and column positions in the data also is not correct toward the end of the first line of header cells.
It appears that the width of the header is fixed to 10000px and the width of the row cells can be much wider and this is what is causing the rendering problem.
The style for slick-header-columns is set explicitly by slick.grid.js to: style="width: 10000px; left: -1000px".
When I inspect the css via firebug in this wrapping state, I see that the width of each slick-row is set to: 12805px. When I manually change the width of the slick-header-columns width to 15000px, the rendering is correct and the header no longer wraps.
Is there a way to programatically update the header width so that it can hold all of the column cells?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决这个问题的方法是修改 slick.grid.js 中的 setCanvasWidth 函数,以便它更新标题宽度和画布宽度:
My solution to this problem was to modify the setCanvasWidth function in slick.grid.js so that it updates the header width as well as the canvas width: