1. 程式人生 > >jqGrid設定三級表頭和表頭合併

jqGrid設定三級表頭和表頭合併

		$(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: ' '},//不設值需要給個空字串
		        ] 
		  });    
		});