简体   繁体   中英

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 ?

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

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

The code is CoffeeScript.

$(window).resize -> grid.resizeCanvas()

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

$(window).resize(function(){
    var h=$(window).height();
    $('#myGrid').css({'height':(h-65)+'px'});
    grid.resizeCanvas();
});

This seems to work just fine:

$( window ).resize( function() {
    grid.resizeCanvas();
});

did this way :

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

Thanks to jQuery and its height() function

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM