转载注明出处:https://blog.csdn.net/sinat_38818576/article/details/89497369
var person = [];
var tableUrl = srcPath + 'order/getthisorder';
$.post(tableUrl,{
orderid: orderid
},function(data) {
var obj = $.parseJSON(data);
if(obj.message == 'SUCCESS'){
person = [];
var ctn = {
name: obj.data.name,
phone: obj.data.phone,
addressid: obj.data.addressid
}
person.push(ctn);
$('#reportTable').bootstrapTable({
columns: [{
field: "name",
title: "联系人",
align: "center",
valign: "middle"
}, {
field: "phone",
title: "手机号码",
align: "center",
valign: "middle"
}, {
field: "addressid",
title: "收货地址",
align: "center",
valign: "middle"
}],
data: person
})
}
});
这种写法适用于如下图所示的数据格式