jQuery UI Widgets › Forums › Grid › Grid does not refresh on window resize
Tagged: #jqwidgets-grid, bootstrap resize, grid resize, javascript grid, jquery grid, window resize grid refresh
This topic contains 8 replies, has 4 voices, and was last updated by Martin 4 years, 5 months ago.
-
Author
-
Hello,
I have a jqgrid inside a bootstrap col-6. If the window is opened say 75% the grid shows fully across. If I maximize or resize the window larger the grid does not resize to full width. Is it my responsibility to handle window resize events and them manually refresh the widget? Seems odd that I’d need to do this.Thanks.
RobHello robf,
Please review the following example whether it fits your needs.
Let us know if you need further assistance.
Best Regards,
TodorjQWidgets Team
https://www.jqwidgets.comHello,
Your example is fine, however in a bootstrap app that contains other elements the grid is does not refresh leaving half-painted columns. The only way I am able to get the grid to properly repaint is attaching window resize event – i.e.$(window).resize(function() { $('#mygrid').jqxGrid('render'); });
Even, ‘refresh’ does not work – only ‘render’
Again, seems odd that I would need to monitor window resize event for this.
Hello robf,
You could review the following demo and try to use it in your case.
Also you could share a jsfiddle/codepen example with your code which demonstrates the issue then we would be able to properly investigate it.
Best Regards,
TodorjQWidgets Team
https://www.jqwidgets.comHello,
I am stuck for the right answer. When I add a window resize event to refresh any grids when window or splitter resize event occurs, all groups are always collapsed. If I remove the events then the grid does not correctly repaint on resizes. The demo above is ok but please see screen shot for actual behavior.Please help. Prototypes/demos are failing.
Thanks.
Hello robf,
Could you send us a jsfiddle example, so we can review this behavior?
As a workaround, you could try to use theexpandgroup
orexpandallgroups
methods of the grid after you call therender
method.
You could keep information of which groups are expanded before resizing the window using thegetgroup
method.Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/The grid and window don’t follow the browser window size.
This fixed it for me:$(window).bind(‘resize’, function () {
$(“#jqxgrid”).jqxGrid(‘width’,$(window).width());
$(“#jqxwindow”).jqxWindow(‘width’, $(window).width());
$(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘cells’); //refresh screen
}).trigger(‘resize’);This still continues to haunt me when a window resize or splitter resize occurs. The suggested solution by nigel does not work 100% of the time. Window resizing and splitter resize will still render 1) half-drawn grids OR 2) squished columns OR 3) missing toolbar buttons.
The only way I can get a full redraw is to perform full ‘render’ and then all is reset like groupings. The screen shot I provided before is still prevalent even with production build 9.0. https://ibb.co/vQQTKJ1
Is there a ticket out there for this?
Please assist.
Thanks.
RobHello Rob,
Could you, please provide us a working jsfiddle example, so we can reproduce this behavior?
As I mentioned above, as a workaround, you could use theexpandgroup
orexpandallgroups
methods of the grid after you call therender
method.
You could keep information of which groups are expanded before resizing the window using thegetgroup
method.Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.