1、指定列的行合并 * 效果图: * 程序: [javascript] view plain copy function mergeGridColCells(grid,rowFildName) { var rows=grid.datagrid('getRows' ); //alert(rows.length); //alert(rows[1][rowFildName]); var startIndex=0; var endIndex=0; if(rows.length< 1) { return; } $.each(rows, function(i,row){ if(row[rowFildName]==rows[startIndex][rowFildName]) { endIndex=i; } else { grid.datagrid( 'mergeCells',{ index: startIndex, field: rowFildName, rowspan: endIndex -startIndex+1 }); startIndex=i; endIndex=i; } }); grid.datagrid( 'mergeCells',{ index: startIndex, field: rowFildName, rowspan: endIndex -startIndex+1 }); } *参数说明 grid: easyUI的datagrid对象 rowFildName: 和并列的field属性值