Is there any way to get jqGrid to adjust its height automatically to the number of rows; but when a certain height is reached that its height cannot increase anymore and that the vertical scrollbar apprears?
Thanks D
Is there any way to get jqGrid to adjust its height automatically to the number of rows; but when a certain height is reached that its height cannot increase anymore and that the vertical scrollbar apprears?
Thanks D
I would recommend you to set
"max-height"
property on the bdiv of jqGrid and useheight:'100%'
orheight:'auto'
:The
"max-height"
property will be not used by IE6, but more recent web browsers will use it.UPDATED: Free jqGrid introduce in version 4.10.0 new property:
maxHeight
which do exactly the same as above. Thus one can just usemaxHeight: 300
instead of manual setting ofmax-height
of the parentdiv.ui-jqgrid-bdiv
.Our UI person solved the problem (expand the list up to 300px, if there are more than 10 attachments, show a vertical scrollbar) with css
300px happens to be height of 10 items in our case. Of course using jquery you can determine the height of 1 item and multiply by 10. But this solution was quick, simple and solved our problem.
Add this:
after loading jqgrid on your desired page, this worked for me.
try this
Try this
This code will adjust height of grid according to the Number of rows in a grid
Try these methods