比海更深chill 2016-12-07 08:39 采纳率: 0%
浏览 1920
已结题

easyui的datagrid网格错位

加载完成后就是出现这种错位现象,但是只要调整一下就会全部对齐
行的宽度也设置了,但是无论宽度设置多少,头部数据的宽度总是会比内容数据的宽度宽一点
表格是采用的加载本地json文件的方式

html

 <input id="cc" name="dept" value="01">

js代码

 $('#cc').datagrid({
    idField: 'location',
    url: 'data.json',
    columns: [
        [
            { field: 'location', title: '位置', align: "center", width: 120, rowspan: 2 }, 
            { title: '类别', halign: "center", colspan: 6 },
            { field: 'year', title: '统计年份', align: "center", width: 120, rowspan: 2 },
        ],[
            { field: 'warnning', title: '警示桩(根)', align: "center", width: 120, },
            { field: 'cover', title: '水泥盖板(个)', align: "center", width: 120, },
            { field: 'sign', title: '标志牌(个)', align: "center", width: 120, },
            { field: 'pillar', title: '立柱(根)', align: "center", width: 120, },
            { field: 'net', title: '铁丝网(平方米)', align: "center", width: 120, },
            { field: 'stone', title: '路缘石(米)', align: "center", width: 120, },
        ]
    ],
});

json

 {"rows":[
    {"location":"k3467-K3468", "warnning":"20", "cover":"13", "sign":"24", "pillar":"15", "net":"667", "stone":"3000", "year":"2016-3"},
    {"location":"k3468-K3469", "warnning":"12", "cover":"23", "sign":"34", "pillar":"45", "net":"467", "stone":"5000", "year":"2015-3"},
    {"location":"k3470-K3471", "warnning":"54", "cover":"34", "sign":"56", "pillar":"76", "net":"657", "stone":"3000", "year":"2015-7"},
    {"location":"k3475-K3476", "warnning":"23", "cover":"53", "sign":"264", "pillar":"165", "net":"467", "stone":"5600", "year":"2016-3"}
  ]
}
  • 写回答

3条回答

  • cookie3ms 2016-12-07 13:16
    关注

    改为

    试试
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码