How to detect grid resize

Hi,
We are using 8.1 version and I have the following requirements : when app is in desktop mode we show grid with 6 columns. They are properly resized by grid definition setMaximumWidth, setMinimumWidth, setExpandRatio. But when app is used on tabled or mobile, we should have only 1 column with all required content. My idea is to remove some columns from grid if grid width is changed. How can I detect this? Or I should some this problem other way?.
Thank you
Regards,
Matic

Hi,

one option would be to use the SizeReporter add-on, if you need to know the width of the actual grid, but you could also just query
Page.getCurrent().getBrowserWindowWidth() if you’re ok with knowing the browser window width only. If you want to do that every time the screen is resized, you can use
Page.getCurrent().addBrowserWindowResizeListener() to add a resize listener.

-Olli
.