How do I autosize the column in SlickGrid?

前端 未结 7 1307
情歌与酒
情歌与酒 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 01:14

    I added this after the grid is drawn and it works fine.

    $(window).resize(function() {
    var cols = grid.getColumns();
    grid.setColumns(cols);
    })
    

提交回复
热议问题