Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / jQuery

Resizing grid when window is resized

5.00/5 (4 votes)
18 Nov 2011CPOL 20.6K  
How to resize a grid when browser window resizes.

In order to resize a grid when the browser window changes its size, you can subscribe to the window.onresize event using jQuery.


Here is an example:


JavaScript
$(window).resize(function() {
    
    $(#grid).height($(window).height());
    $(#grid).width($(window).width());
});

If you want to do the same using ExtJs framework, please see this link
http://myextjs.blogspot.com/2011/11/resize-window-resize-grid.html[^].

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)