var grid = $("#jqGrid").jqGrid({
url: 'data.json',
datatype: "json",
colModel: [
{ label: 'Category Name', name: 'CategoryName', width: 100 },
{ label: 'Product Name', name: 'ProductName', width: 110 },
{ label: 'Country', name: 'Country', width: 200 },
{ label: 'Price', name: 'Price', width: 180, sorttype: 'integer' },
// sorttype is used only if the data is loaded locally or loadonce is set to true
{ label: 'Quantity', name: 'Quantity', width: 180, sorttype: 'number' }
],
loadonce: true,
width: 600,
height: 200,
rowNum: 150,
shrinkToFit : false,
sortable: { options: {
//scrollSensitivity : 5,
forcePlaceholderSize : true,
forceHelperSize: true,
start : function( e, ui) {
var sc = $(".ui-jqgrid-hdiv ");
sc.css('overflow-x','auto');
},
stop : function( ev, ui) {
var sc = $(".ui-jqgrid-hdiv ").scrollLeft();
//console.log(sc);
grid[0].grid.bDiv.scrollLeft = sc;
//console.log(grid[0].grid.bDiv.scrollLeft);
$(".ui-jqgrid-hdiv ").css('overflow-x','hidden');
}
} },
pager: "#jqGridPager"
});