Datatable with fixRowHeight = false and adjustRowHeight() dynamic pager.size

Browser window got always different innerHeight and in my datatable I have a pager with a defined size means different row count for each page. I don’t want to scroll the page down to get the datatable end for browsing to the next page. The datatable should with one page should be shown on the hole browser window even when resizing the browser height. For this I have a method tableRowsRenew(datatableObject).

My idea is to get the innerheight of the browser wHeight and to get the height of each row with row.$height.

Then I iterate and have the iterateCount and in there I add all rowHeight and if it is larger then wHeight then I have the pager.size = iterateCount.

Did someone get a similar problem and a better solution?

Thank you so much for any hint

Michael