Grid resize on window resize

Is there a way to size the grid to fill the viewport on browser resize?
On load, the grid fills the screen, but if the user resizes the screen, the grid does not adjust its size.
I tried grid.paint(), but that does not seem to do anything.
I am using dhtmlxSuite v.8.3.6 Professional.

Thanks,
Scott

1 Like

The easiest solution is to place your grid into the layout cell:
https://snippet.dhtmlx.com/hid64zup
In this case it will adjust automatically according to the size of the layout cell.

Otherwise you can adjust the grid sizes manually on the window resize using the following code:

grid.config.height = document.querySelector("#grid").offsetHeight;
grid.config.$height = document.querySelector("#grid").offsetHeight;
grid.config.width = document.querySelector("#grid").offsetWidth;
grid.config.$width = document.querySelector("#grid").offsetWidth;

Like:
https://snippet.dhtmlx.com/pyfdqa3i

Thank you!!! That is what I needed.