i have .aspx page in which my jqgrid is display in mobile browser.

on page load it will calculate grid width as per the browser width, and on page load which is looks fine.

but if do a mobile orientation(portrait to landscape) change than grid is not getting width as per new screen width.

is there any way out to handle this ?

thanks in advance.

有帮助吗?

解决方案

i got the solution, just you have to use the window orientation event.

following is the code you can use it for the same.

window.onorientationchange = function () { resizeJqGridWidth("GridID", "Grid_wrapper"); }

function resizeJqGridWidth(grid_id, div_id) {
//Resized to new width as per window
$('#' + grid_id).setGridWidth($('#' + div_id).width(), true);

}

Enjoy

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top