How to get slickgrid div to resize with size of table

后端 未结 3 1633
傲寒
傲寒 2021-01-06 17:22

I hope we have some users familiar with slickGrid seeing as how StackOverflow uses it also :)

I have a HTML containing my slickGrid as follows:

  <         


        
3条回答
  •  清酒与你
    2021-01-06 18:23

    I suggest adding the following code to the onpagingInfoChanged

    dataView.onPagingInfoChanged.subscribe(function (e, pagingInfo) {
    //......
    
    ///******************************************************
        var divSize = 2 + (options.rowHeight * (pagingInfo.pageSize +1)); 
        $("#myGrid").css( 'height' , divSize+'px' )
        grid.resizeCanvas()
    ///*******************************************************
    
    });
    

    Being a bit lazy, I added the 2 px to the height to ensure the VScrollbar doesn't appear but I'm sure you can figure out something more pleasing.

提交回复
热议问题