⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grid_complexheader.html

📁 dhtmlxGrid 是跨浏览器的 JavaScript 表格控制组件(Grid Control)
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>DHTML Grid samples. dhtmlXGrid - Multirow header</title>
	<meta name="KEYWORDS" content="dhtmlxgrid, dhtml grid, javascript grid, javascript, DHTML, grid, grid control, dynamical scrolling, xml, AJAX, API, cross-browser, checkbox, XHTML, compatible, gridview, navigation, script, javascript navigation, web-site, dynamic, javascript grid, dhtml grid, dynamic grid, item, row, cell, asp, .net, jsp, cold fusion, custom tag, loading, widget, checkbox, drag, drop, drag and drop, component, html, scand">

<meta name="DESCRIPTION" content="Cross-browser DHTML grid with XML support and powerful API. This DHTML JavaScript grid can load its content dynamically from server using AJAX technology.">

</head>
<style>
	body, . {font-size:12px;font-family:arial;}
	h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
	xmp {color:green;font-size:12px;font-family:courier;background-color:#e6e6fa;padding:2px}
	DIV.txt{
		margin-top:10px;
		font-size:12px;font-family:arial;
	}
	div.hdr{
		background-color:lightgrey;
		margin-bottom:10px;
		padding-left:10px;
	}
	div.h3{
		padding-left:10px;
		padding-right:10px;
		margin-bottom:10px;
		margin-top:10px;
		font-size:14px;
		font-family: verdana;
		color:white;
		background-color:green;
		width:300px;
		white-space:nowrap;
		display:table;
	}
</style>
<body>
	<div class="hdr">DHTML JavaScript Grid samples </div>
	<h1>Multirow header</h1>
	<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXGrid.css">
	<script  src="../js/dhtmlXCommon.js"></script>
	<script  src="../js/dhtmlXGrid.js"></script>
	<script  src="../js/dhtmlXGridCell.js"></script>
<div class="h3">Setting multirow header with script</div>
	<div id="gridbox" width="600px" height="200px" style="background-color:white;"></div>
	<div><a href="javascript:void(0)" onclick='mygrid.attachHeader(["#rspan","Title","Author","#rspan","#rspan","#rspan","Bestseller","Published"]);mygrid.setSizes();'>Extend Header</a></div>
<XMP>
	//add second row to header
	mygrid.attachHeader("#rspan,Title,Author,#rspan,#rspan,#rspan,Bestseller,Published");
	mygrid.setSizes();
	//#rspan - include cell in rowspan
	//#cspan - include cell in colspan
</XMP>	
	
<div class="h3">Setting multirow header with XML (Professional Edition)</div>
	<div id="gridbox2" width="600px" height="100px" style="background-color:white;"></div>
<XMP>
	...
	<head>
		<beforeInit>
			<call command="attachHeader">
				<param>#rspan,Title,Author,#rspan,#rspan,#rspan,Bestseller,Published</param>
			</call>
		</beforeInit>	
		...
</XMP>
	
<hr>

<script>


	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../imgs/");
    mygrid.setHeader("Sales,Book,#cspan,Price,In Store,Shipping,Other Info,#cspan");
	mygrid.setInitWidths("50,150,150,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("ed,ed,ed,price,ch,co,ra,ro");
    mygrid.getCombo(5).put(2,2);
	mygrid.setColSorting("int,str,str,int,str,str,str,str")
	mygrid.setColumnColor("white,#d5f1ff,#d5f1ff")
    mygrid.setColumnMinWidth(50,0);
	mygrid.init();
	mygrid.loadXML("grid.xml");
	
	

</script>
<p><a href="http://www.scbr.com/docs/products/dhtmlxGrid/index.shtml" style="font-weight:bold;">Go to the dhtmlxGrid main page</a> or <a href="javascript:self.close()">Close this page</a></p>
	
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -