码迷,mamicode.com
首页 > Web开发 > 详细

jQuery_easyUI 合并单元格 (DataGrid 数据表格)

时间:2014-06-20 15:01:13      阅读:310      评论:0      收藏:0      [点我收藏+]

标签: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 合并几个单元格

 

 

jQuery_easyUI 合并单元格 (DataGrid 数据表格),布布扣,bubuko.com

jQuery_easyUI 合并单元格 (DataGrid 数据表格)

标签:style   class   blog   code   java   get   

原文地址:http://www.cnblogs.com/dnxf/p/3797026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!