How do I autosize the column in SlickGrid?

前端 未结 7 1318
情歌与酒
情歌与酒 2020-12-08 00:25

I want slickgrid to autosize the columns based on the widest content or header text - whichever is wider. In simpler terms, I want it to simulate the default behavior of reg

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 00:49

    Insert the text into an off-screen element and retrieve the width of the element. This is what excanvas does to measure text. Use this to set the width of the column since it's expecting a pixel value.

提交回复
热议问题