jqgrid subgrid scrollbar issue
HTML
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/redmond/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://rawgit.com/tonytomov/jqGrid/master/css/ui.jqgrid.css">
<script src="https://rawgit.com/tonytomov/jqGrid/master/js/i18n/grid.locale-en.js"></script>
<script src="https://rawgit.com/tonytomov/jqGrid/master/js/jquery.jqGrid.js"></script>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
JavaScript
$.jgrid.extend({
setColWidth: function(iCol, newWidth, adjustGridWidth) {
"use strict";
return this.each(function() {
var $self = $(this),
grid = this.grid,
colName, colModel, i, nCol;
if (typeof iCol === "string") {
// the first parametrer is column name instead of index
colName = iCol;
colModel = $self.jqGrid("getGridParam", "colModel");
for (i = 0, nCol = colModel.length; i < nCol; i++) {
if (colModel[i].name === colName) {
iCol = i;
break;
}
}
if (i >= nCol) {
return; // error: non-existing column name specified as the first parameter
}
} else if (typeof iCol !== "number") {
return; // error: wrong parameters
}
grid.resizing = {
idx: iCol
};
grid.headers[iCol].newWidth = newWidth;
if (adjustGridWidth !== false) {
grid.newWidth = grid.width + newWidth - grid.headers[iCol].width;
}
grid.dragEnd(); // adjust column width
if (adjustGridWidth !== false) {
$self.jqGrid("setGridWidth", grid.newWidth, false); // adjust grid width too
}
});
}
});
var mainGrid = {
"total": 1,
"page": 1,
"pageSize": 20,
"records": 1,
"rows": [{
"siteId": 12516086,
"siteName": "Detroit",
"siteAddress": "1 Woodward",
"siteCitySt": "Detroit, MI",
"siteZip": "48205",
"productCd": "ProductX",
"productName": "Product X",
"finishedSize": null,
"estimatedPieceWeight": 0.125,
"vdpTypeCode": null,
"taHouseholds": 1071689,
"taDistribution": 445139,
"distribution": 445139,
"avgCpm": 32.32084084084084084084084084084084084084,
"investment": 19542.8,
"coverage": 41.54
}]
};
var subGridData = {
"total": 1,
"page": 1,
"pageSize": 20,
"records": 2,
"rows": [{
"mediaPlanId": 3003,
"mbuHdrId": 4035986,
"mbuDtlId": 10442611,
"commonMbuId": 99731,
"ggId":...