Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI DataGrid - Merging Cells

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 IDItem ID
PriceAttributeStauts
List PriceUnit 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

Download jQuery EasyUI Examples

jeasyui-datagrid-datagrid13.zip