resizing of grid when resizing browser window

穿精又带淫゛_ 提交于 2019-12-06 00:10:51

问题


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.


回答1:


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

The code is CoffeeScript.

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



回答2:


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

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



回答3:


did this way :

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

Thanks to jQuery and its height() function




回答4:


This seems to work just fine:

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


来源:https://stackoverflow.com/questions/9084408/resizing-of-grid-when-resizing-browser-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!