0
我想创建一个具有detailInit功能的剑道网格,但我不知道如何实现它。如何创建剑道网格detailInit
如何显示的地址[目标,对象]在我的网格detailsInit函数,其中允许用户切换到显示的细节并没有低于所需输出的样本数据: -
电流输出:
Name | Phone | Address
------------------------------------------------
John Smith | (519) 420-2391 | [object Object]
------------------------------------------------
James Seth | (123) 212-3332 | [object Object]
想输出:
Name | Phone |
--------------------------------
John Smith | (519) 420-2391 |
--------------------------------
^ Location | no |
-----------------------------
london | 123 |
aus | 456 |
var peoples = [],
address = [];
peoples = [{
id: 1,
name: "John Smith",
phone: "(519) 420-2391",
address: [{
Location: "london",
no: "123"
}, {
Location: "aus",
no: "456"
}]
}, {
id: 2,
name: "James Seth",
phone: "(123) 212-3332",
address: [{
Location: "Paris",
no: "789"
}, {
Location: "ita",
no: "888"
}]
}];
$("#grid").kendoGrid({
dataSource: {
data: peoples,
},
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>