jQuery_easyUI 合併儲存格 (DataGrid 資料表格)

來源:互聯網
上載者:User

標籤:style   class   blog   code   java   get   

<table id="dg" style="height:350px;z-index:-5555; " class="easyui-datagrid"  rownumbers="true"               data-options="fitColumns: true,               iconCls: ‘icon-edit‘,                scrollbarSize:0,                multiSort:true,                remoteSort:true,                pagination:false,singleSelect:false,onLoadSuccess:OnLoadSucc,method: ‘get‘"><thead><tr><th data-options="styler:gethand,field:‘ORGNA_NAME‘,width:20,halign:‘center‘,align:‘left‘">單位名稱</th><th data-options="styler:gethand,field:‘NIANYUE‘,width:10,halign:‘center‘,align:‘center‘">結算期間</th><th data-options="styler:gethand,field:‘DJ_TBS‘,width:10,halign:‘center‘,align:‘right‘">台班數<br>(個)</th><th data-options="styler:gethand,field:‘DJ_JSJE‘,width:10,halign:‘center‘,align:‘right‘">結算金額<br>(元)</th><th data-options="styler:gethand,field:‘USERCODE‘,width:16,halign:‘center‘,align:‘left‘,formatter: getQz">領導簽字</th></tr></thead></table>

 

介面代碼

 

合并方法:

function OnLoadSucc() {   var data=$("#dg").datagrid("getData");      var rows=data.rows.length;      if(rows>1){           $("#dg").datagrid(‘mergeCells‘,{                 index: 0,                 field: ‘ORGNA_NAME‘,                 colspan: 2,                 align:‘center‘             });   }  }

 說明:

  index 第幾行合并

  field 合并的列元素名稱

  colspan 合并幾個儲存格

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.