0

I have following webpage which is using Free jQGrid 4.15.2. Page has a fixed header and a filter area.

Image

Question:

I need to set height of grid so

  1. When user select row count in footer (e.g. 10) that can fit in remaining height of window, grid height change to [rowcount selectd]*[row height] even in last page.

  2. When user selects row count that cannot fit in the window (e.g. 100), maximum available height is selected, or in other word, grid fill available height of window so no scroll bar shown on window but grid scrollbar shown in grid row area.

This means footer need to be in screen all the time and doesn't move when user navigates in data, unless user change row count in footer.

Notes:

  • I can get available height of the page, height of data row, grid caption, header, footer and also row count selected in footer to set height in grid properties or ui-jqgrid-bdiv which both are height of data area of grid. However I would like to know if there is a more elegant way of doing this, like setting min-height and max-height instead of calculating grid height and setting it every time user selects a different row count.

  • Setting grid height to auto, will cause height of last page of grid that normally has less rows, reduce to total rows shown thus footer will move up which is not desired.

  • Setting height as mentioned in this answer will only set height of inner data area of grid. I need to count in size of footer, header and title of grid too. Trying to set height of parents of ui-jqgrid-bdiv showing strange behaviors (taller first row, footer separated from grid, ...).

  • User can customize size of grid font, so adding a fixed magic numbers as mentioned in this answer, will not help.

AaA
  • 3,600
  • 8
  • 61
  • 86
  • Cant you control the width and height of the div its created in? – Grumpy Jan 26 '20 at 09:37
  • Size of container doesn't dictate height of grid, however with of parent will adjust width of the child, but width is not the issue, I need to adjust the height. – AaA Jan 27 '20 at 14:48
  • 1
    I find this requirement very interesting and will try to prepare a method which will do this in [Guriddo jqGrid](http://www.guriddo.net). I'm not sure that it will work in free-jqGrid, but you can try it. Hope to be ready at end of week. I will inform you. – Tony Tomov Jan 28 '20 at 09:36
  • Hello. Sorry for delay - I will try to implement it ASAP. – Tony Tomov Feb 06 '20 at 10:13

0 Answers0