7

I used a fill whole window example as a default. Tried to resize browser window: but area, that is used for grid is the same. Need to reload page so that it fits. How can I archive this without reloading page ?

Edited

Interesting fact that when I change order of columns grid is resized.

Iurii Dziuban
  • 1,091
  • 2
  • 17
  • 31

4 Answers4

12

This works fine for me. Maybe the resizeCanvas() function is a new feature in slick grid.

The code is CoffeeScript.

$(window).resize -> grid.resizeCanvas()
biofractal
  • 18,963
  • 12
  • 70
  • 116
5

This works better than just changing .slick-viewport height.

$(window).resize(function(){
    var h=$(window).height();
    $('#myGrid').css({'height':(h-65)+'px'});
    grid.resizeCanvas();
});
sivann
  • 2,083
  • 4
  • 29
  • 44
1

This seems to work just fine:

$( window ).resize( function() {
    grid.resizeCanvas();
});
Unicco
  • 2,466
  • 1
  • 26
  • 30
1

did this way :

$(window).resize(function () {
    $("#grid").height($("<container for grid>").height());
$(".slick-viewport").height($("#grid").height());
});

Thanks to jQuery and its height() function

Iurii Dziuban
  • 1,091
  • 2
  • 17
  • 31