我正在尝试使用动态列和显示[object Object]的数据来实现kendo网格。
如何在我的kendo网格中显示地址[object,Object]数据,我希望示例输出如下表所示: -
Name | Phone | Address
------------------------------------------------
John Smith | (519) 420-2391 | Address 1: London
| | Address 2: 123
var peoples = [],
address = [];
peoples = [{
id: 1,
name: "John Smith",
phone: "(519) 420-2391",
address: [{
address1: "london",
address2: "123"
}]
}];
$("#grid").kendoGrid({
dataSource: {
data: peoples,
},
scrollable: true,
sortable: true,
resizable: true,
pageable: true,
columnMenu: true,
columns: [{
field: "name",
title: "Name"
}, {
field: "phone",
title: "Phone number"
}, {
field: "address",
title: "Address"
}],
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css">
<script src="http://code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/angular.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
</head>
<body>
<div id="example">
<div id="grid"></div>
</div>
</body>
</html>