2 xu 76 nie xu_76_nie 于 2016.05.05 16:56 提问

easyUI datagrid 表体比表头的列少

本人新手,求教:表体比表头列少,前面还有红色圈出来的区域不知道哪来的?而且表头列与表体列无法对齐。 来个大神告诉我怎么改,谢谢。
以下是代码:
fit:true,
pagination:true,
fitColumns:true,
nowrap : false,
striped : true,
rownumbers:true,
showFooter:true,

            columns: [[
                {title:'馆藏单位',colspan:1,rowspan:3},
                {title:'书目',colspan:20,rowspan:1},
                {title:'签到',colspan:3,rowspan:2},
            ],[
                {title:'上载次数',colspan:1,rowspan:2},
                {title:'EP(科技期刊)',colspan:2,rowspan:1},
                {title:'EM(科技会议)',colspan:2,rowspan:1},
                {title:'EJ(文集汇编)',colspan:2,rowspan:1},
                {title:'ES(科技丛书)',colspan:2,rowspan:1},
                {title:'ER(科技报告)',colspan:2,rowspan:1},
                {title:'EG(工具书)',colspan:2,rowspan:1},
                {title:'EB(科技专著)',colspan:2,rowspan:1},
                {title:'GT(港台期刊)',colspan:2,rowspan:1},
                {title:'小计',colspan:3,rowspan:1}
            ],[
                //馆藏单位
                {field:'libCode',width:100,align:'center',sortable:true},
                //上载次数
                {field:'Count',width:100,align:'center',sortable:true},
                //EP(科技期刊)
                {field:'epHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'epBase',title:'入库数',width:100,align:'center',sortable:true},
                //EM(科技会议)
                {field:'emHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'emBase',title:'入库数',width:100,align:'center',sortable:true},
                //EJ(文集汇编)
                {field:'ejHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'ejBase',title:'入库数',width:100,align:'center',sortable:true},
                //ES(科技丛书)
                {field:'esHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'esBase',title:'入库数',width:100,align:'center',sortable:true},
                //ER(科技报告)
                {field:'erHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'erBase',title:'入库数',width:100,align:'center',sortable:true},
                //EG(XXXXXXXX)
                {field:'egHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'egBase',title:'入库数',width:100,align:'center',sortable:true},
                //EB(科技专著)
                {field:'ebHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'ebBase',title:'入库数',width:100,align:'center',sortable:true},
                //GT(港台期刊)
                {field:'gtHarvest',title:'上载数',width:100,align:'center',sortable:true},
                {field:'gtBase',title:'入库数',width:100,align:'center',sortable:true},
                //小计
                {field:'',title:'上载数',width:100,align:'center',sortable:true},
                {field:'',title:'入库数',width:100,align:'center',sortable:true},
                {field:'',title:'不规范数',width:100,align:'center',sortable:true},
                //签到
                {field:'',title:'上载次数',width:100,align:'center',sortable:true},
                {field:'',title:'上载数',width:100,align:'center',sortable:true},
                {field:'',title:'入库数',width:100,align:'center',sortable:true},
            ]],
    toolbar:'#tb'

    以下是效果图:

图片说明

2个回答

jhfsdfs
jhfsdfs   2016.05.05 18:06

你自己写的filed为空

CSDNXIAON
CSDNXIAON   2016.05.05 17:02

jquery-easyui拓展之datagrid复合表头列锁定/解锁和列隐藏/显示
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!