SlickGrid Col调整大小问题

时间:2013-11-15 18:38:36

标签: slickgrid

我正在尝试在这里找到一个快速修复,当我调整SlickGrid列的大小时,标题行相对于网格的主体几个像素关闭。我试过syncColumnCellResize: true,但仍无法解决问题,我们非常感谢任何建议。

  1. 在调整大小之前,列完美对齐 enter image description here

  2. 调整大小后,请注意标题行是几个像素关闭 enter image description here

  3. 3.Grid Options(我正在使用ColumnPicker插件)

      var options = {
        editable: true,
        enableCellNavigation: true,
        enableColumnReorder: true,
        showHeaderRow: true,
        headerRowHeight: 30,
        explicitInitialization: true,
        enableTextSelectionOnCells: true,
        syncColumnCellResize: true,
        autoEdit: false
    };
    

2 个答案:

答案 0 :(得分:0)

我遇到了类似的错位问题,似乎只是通过使用forceFitColumns: true并设置minWidthwidthmaxWidth的3个属性来解决它...你也可以查看我也提供答案的这些问题,它也可以帮助你:
Slickgrid: Final column auto size to use all remaining space
Slickgrid column width should automatically get resized according to widest row content

答案 1 :(得分:0)

如果您使用的是bootstrap或其他一些css lib。您可以尝试将以下css添加到您的代码中。

/* compatible with both IE and Chrome */
.slick-header-columns * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}