標籤: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 合并幾個儲存格