亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

jQuery EasyUI中文參考手冊(cè) / jEasyUI合并單元格

jEasyUI合并單元格

數(shù)據(jù)網(wǎng)格(datagrid)經(jīng)常需要合并一些單元格。本教程將向您展示如何在數(shù)據(jù)網(wǎng)格(datagrid)中合并單元格。

為了合并數(shù)據(jù)網(wǎng)格(datagrid)單元格,只需簡(jiǎn)單地調(diào)用 'mergeCells' 方法,并傳入合并信息參數(shù),告訴數(shù)據(jù)網(wǎng)格(datagrid)如何合并單元格。在所有合并的單元格中,除了第一個(gè)單元格,其它單元格在合并后被隱藏。

66.png

創(chuàng)建數(shù)據(jù)網(wǎng)格(DataGrid)

	<table id="tt" title="Merge Cells" style="width:550px;height:250px"
			url="data/datagrid_data.json"
			singleSelect="true" iconCls="icon-save" rownumbers="true"
			idField="itemid" pagination="true">
		<thead frozen="true">
			<tr>
				<th field="productid" width="80" formatter="formatProduct">Product ID</th>
				<th field="itemid" width="100">Item ID</th>
			</tr>
		</thead>
		<thead>
			<tr>
				<th colspan="2">Price</th>
				<th rowspan="2" field="attr1" width="150">Attribute</th>
				<th rowspan="2" field="status" width="60" align="center">Stauts</th>
			</tr>
			<tr>
				<th field="listprice" width="80" align="right">List Price</th>
				<th field="unitcost" width="80" align="right">Unit Cost</th>
			</tr>
		</thead>
	</table>

合并單元格

當(dāng)數(shù)據(jù)加載之后,我們合并數(shù)據(jù)網(wǎng)格(datagrid)中的一些單元格,所以放置下面的代碼在 onLoadSuccess 回調(diào)函數(shù)中。

	$('#tt').datagrid({
		onLoadSuccess:function(){
			var merges = [{
				index:2,
				rowspan:2
			},{
				index:5,
				rowspan:2
			},{
				index:7,
				rowspan:2
			}];
			for(var i=0; i<merges.length; i++)
				$('#tt').datagrid('mergeCells',{
					index:merges[i].index,
					field:'productid',
					rowspan:merges[i].rowspan
				});
		}
	});

下載 jQuery EasyUI 實(shí)例

jeasyui-datagrid-datagrid13.zip