• 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属性值
  • 相关阅读:
    计算机三级数据库-指导
    spring导入约束
    hibernater获取session时org.hibernate.service.spi.ServiceException错误
    springxml配置注入报错
    右键复制类的完整路径
    关于实体里的toString方法
    idea创建web项目环境
    框架快速找类
    如何在scdn博客里搜索自己博客文章
    永久消除自动产生的QQPCMgr
  • 原文地址:https://www.cnblogs.com/yinchuan/p/5344110.html
Copyright © 2020-2023  润新知