문제

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