Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top