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属性值
  • 相关阅读:
    转:Node.js邮件发送组件- Nodemailer 1.0发布
    USACO 5.4 Betsy's Tour(暴力)
    USACO 5.4 Character Recognition(DP)
    Codeforces Round #196 (Div. 2)
    HDU 4681 String(DP)
    HDU 4679 Terrorist’s destroy
    HDU 4669 Mutiples on a circle(环状DP)
    HDU 4666 Hyperspace(曼哈顿距离)
    HDU 2852 KiKi's K-Number(离线+树状数组)
    POJ 3335 Rotating Scoreboard(多边形的核)
  • 原文地址:https://www.cnblogs.com/yinchuan/p/5344110.html
Copyright © 2011-2022 走看看