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

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
    关注

    改为

    试试
    评论

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题