问题
I need to adjust my jqgrid height dynamically to fit in the browser window as screen resolution changes.I need to calculate the header and footer ,and form(optional)..Then grid should be fitted in the remaining space.
回答1:
You could set the height of the .ui-jqgrid-bdiv element via css calculating the height based on the window.innerHeight property.
Like here I will set the grid height to be 70% of the available window space:
$("#gview_mygrid > .ui-jqgrid-bdiv").css('height', window.innerHeight * .7);
You would need to recalculate this on each resolution change but that should be pretty straight forward.
来源:https://stackoverflow.com/questions/9920399/adjust-jqgrid-height