EasyUI DataGrid 多级表头设置

使用EasyUI做一个报表统计,需要合并表头为多级表头,核心代码如下:

$('#dg').datagrid({  
    url:'datagrid_data.action',  
    fit : true,
    fitColumns : false,
    columns:
         [
             [
                {"title":"网格员考核测评表","colspan":9} ], [ {"field":"ORGNAME","title":"网格","rowspan":3,width:"80"}, {"field":"USERZH","title":"网格员","rowspan":3,width:"80"}, {"title":"工作纪律","rowspan":2}, {"title":"民主互评","rowspan":2}, {"title":"志愿者","rowspan":2}, {"title":"加分项","colspan":2}, {"title":"总分","rowspan":2}, {"title":"平均分","rowspan":2} ], [ {"title":"信息上报","rowspan":1}, {"title":"简报采纳","rowspan":1} ], [ {"field":"YW1","title":"5分","rowspan":1}, {"field":"YW2","title":"5分","rowspan":1}, {"field":"YW3","title":"6分","rowspan":1}, {"field":"YW4","title":"8分","rowspan":1}, {"field":"YW5","title":"5分","rowspan":1}, {"field":"TOTAL","title":"","rowspan":1}, {"field":"AVG","title":"","rowspan":1} ] ] }); 

 

以上代码和图中可以看出表头共有4行9列, 画单元格就和HTML中一样,主要利用 rowspancolspan 属性

在将要显示内容的列上添加 field 属性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值