最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - resizing of grid when resizing browser window - Stack Overflow

programmeradmin2浏览0评论

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.

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.

Share Improve this question edited Feb 1, 2012 at 9:01 Iurii Dziuban asked Jan 31, 2012 at 17:49 Iurii DziubanIurii Dziuban 1,0912 gold badges18 silver badges31 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 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()

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

$(window).resize(function(){
    var h=$(window).height();
    $('#myGrid').css({'height':(h-65)+'px'});
    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

This seems to work just fine:

$( window ).resize( function() {
    grid.resizeCanvas();
});
发布评论

评论列表(0)

  1. 暂无评论