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属性值
  • 相关阅读:
    win10-wifi无线共享自动关闭解决
    可用的nlog配置
    cmake 常用指令,变量
    window时间服务
    命令行配置服务启动类型
    boost流gzip压缩
    mysql 查询某表的所有列,获取毫秒时间戳
    system进程占用80端口
    centos8重新分区(减小/home空间,增大root空间)
    emqx使用data_to_webservice方式配置规则引擎简单实践
  • 原文地址:https://www.cnblogs.com/yinchuan/p/5344110.html
Copyright © 2011-2022 走看看