【BUG】复杂表头如果子节点长度为1,出现渲染异常的问题

建议 未结 0 59
星夜925
星夜925 2019-10-9
悬赏:20飞吻
==============================正常情况==================================
table.render({
elem:'#business_weight_table',
url: dict.api_business_weight+"/list",
method:'post',
headers: {token: init.token},
toolbar: '#toolbar',
cols:[
[
{align: "center", title: "ggg", colspan: 2},
{align: "center", title: "hhh", colspan: 2},
],
[
{field: "hh", title: "aa", width: 80},
{field: "bb", title: "bb", width: 80},
{field: "cc", title: "cc", width: 80},
{field: "dd", title: "dd", width: 80}
]
],
response: {
statusCode:200
},
parseData:function (res) {
return {
"code":res.status,
"msg":res.message,
"count":res.data.total,
"data":[{
hh: -1,
bb: 0,
cc: 1,
dd: 2,
}]
}
},
page: true
});


==============================如果子节点长度为1==================================
table.render({
elem:'#business_weight_table',
url: dict.api_business_weight+"/list",
method:'post',
headers: {token: init.token},
toolbar: '#toolbar',
cols:[
[
{align: "center", title: "ggg", colspan: 1},
{align: "center", title: "hhh", colspan: 2},
],
[
{field: "hh", title: "aa", width: 80},
{field: "cc", title: "cc", width: 80},
{field: "dd", title: "dd", width: 80}
]
],
response: {
statusCode:200
},
parseData:function (res) {
return {
"code":res.status,
"msg":res.message,
"count":res.data.total,
"data":[{
hh: -1,
bb: 0,
cc: 1,
dd: 2,
}]
}
},
page: true
});
回帖
  • 消灭零回复