jqGrid設定三級表頭和表頭合併
阿新 • • 發佈:2019-01-25
$(function(){ $.topuiRender(); $("#GridId").setGroupHeaders({ useColSpanStyle: true, //表頭是否合併行 groupHeaders:[ {startColumnName: 'ColumnName1', numberOfColumns: 1, titleText: '二級表頭1 '}, {startColumnName: 'ColumnName2', numberOfColumns: 1, titleText: '二級表頭2'}, {startColumnName: 'ColumnName3', numberOfColumns: 1, titleText: '二級表頭3'}, {startColumnName: 'ColumnName4', numberOfColumns: 2, titleText: '二級表頭4'} ] }); jQuery("#jydldlhsGrid").jqGrid("setComplexGroupHeaders",{ complexGroupHeaders:[ {startColumnName: 'ColumnName5', numberOfColumns: 21, titleText: ' 三級表頭1'}, {startColumnName: 'ColumnName6', numberOfColumns: 5, titleText: '三級表頭2'}, {startColumnName: 'ColumnName7', numberOfColumns: 11, titleText: ' '},//不設值需要給個空字串 ] }); });