adjust jqgrid height

家住魔仙堡 提交于 2021-02-20 03:55:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!