Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resizing of grid when resizing browser window

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.

like image 209
Iurii Dziuban Avatar asked Jan 31 '12 17:01

Iurii Dziuban


3 Answers

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

The code is CoffeeScript.

$(window).resize -> grid.resizeCanvas()
like image 110
biofractal Avatar answered Oct 29 '22 19:10

biofractal


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

$(window).resize(function(){
    var h=$(window).height();
    $('#myGrid').css({'height':(h-65)+'px'});
    grid.resizeCanvas();
});
like image 24
sivann Avatar answered Oct 29 '22 19:10

sivann


did this way :

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

Thanks to jQuery and its height() function

like image 33
Iurii Dziuban Avatar answered Oct 29 '22 21:10

Iurii Dziuban