jqgrid固定表头

jQuery(function($){
var grid_selector = "#files-record-main-grid-table";
var pager_selector = "#files-record-main-grid-pager";
grid = jQuery(grid_selector).jqGrid({
url:'query',
datatype : "json",
mytype: "POST",
height : '500',
colNames:['行政区划','红牌数', '黄牌数', '蓝牌数', '不予受理','不予立案','超时办理','撤销立案','变更案由','变更金额','处罚违规','资格监察','重大案件','投诉举报'],
colModel:[

{name:'RegionName', index:'RegionName',align:'left', editable:false}

,

{name:'c1', index:'c1',width:80,align:'right', editable:false}

,

{name:'c2', index:'c2',width:80,align:'right', editable:false}

,

{name:'c3', index:'c3',width:80,align:'right', editable:false}

,

{name:'c4', index:'c4',width:80,align:'right', editable:false}

,

{name:'c5', index:'c5',width:80,align:'right', editable:false}

,

{name:'c6', index:'c6',width:80,align:'right', editable:false}

,

{name:'c7', index:'c7',width:80,align:'right', editable:false}

,

{name:'c8', index:'c8',width:80,align:'right', editable:false}

,

{name:'c9', index:'c9',width:80,align:'right', editable:false}

,

{name:'c10', index:'c10',width:80,align:'right', editable:false}

,

{name:'c11', index:'c11',width:80,align:'right', editable:false}

,

{name:'c12', index:'c12',width:80,align:'right', editable:false}

,

{name:'c13', index:'c13',width:80,align:'right', editable:false}

],
viewrecords:true,
rowNum:500,
rownumbers:false,
rowList:[10, 20, 30],
//pager:pager_selector,
altRows:true,
scroll:true,
forceFit:true,
autoheight:true, //自动拉伸高度
autowidth:true, //自动拉伸宽度
sortorder:"",
sortname:""
});

$(grid).closest(".ui-jqgrid-bdiv").css({ 'overflow-y' : 'scroll' });

});

你可能感兴趣的:(jqgrid固定表头)