zoukankan      html  css  js  c++  java
  • easyUI单元格合并自定义封装

     mergeGridColCells($(this),"AdminType");

    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属性值
  • 相关阅读:
    分布式数据库拆分表常用的方法
    linux服务器502错误详解【转载】
    全国各城市代码
    Linux下git安装
    linux上访问windows目录
    百度技术总监谈12306高性能海量并发网站架构设计
    Ubuntu 10.04 安装无线网卡驱动。
    晕菜, silverlight !
    linux 软件记录.
    硬盘安装 Ubuntu10.04
  • 原文地址:https://www.cnblogs.com/yinchuan/p/5344110.html
Copyright © 2011-2022 走看看