admin管理员组文章数量:1205755
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 badges4 Answers
Reset to default 12This 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();
});
本文标签: javascriptresizing of grid when resizing browser windowStack Overflow
版权声明:本文标题:javascript - resizing of grid when resizing browser window - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738709184a2108093.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论