jQuery EasyUI DataGrid - Merging Cells
A datagrid often needs to merge some cells. This tutorial will show you how to merge cells in a datagrid.
To merge datagrid cells, simply call the 'mergeCells' method and pass in the merge information parameter to tell the datagrid how to merge the cells. Among all merged cells, except for the first one, the other cells are hidden after merging.
Create the DataGrid
Product ID
Item ID
Price
Attribute
Stauts
List Price
Unit Cost
Merging Cells
After the data is loaded, we merge some cells in the datagrid, so place the following code in the onLoadSuccess callback function.
$('#tt').datagrid({
onLoadSuccess:function(){
var merges = [{
index:2,
rowspan:2
},{
index:5,
rowspan:2
},{
index:7,
rowspan:2
}];
for(var i=0; i