剣道UIグリッドとデータソースを使用して、私はREST APIに接続しています。しかし、報告されているカップルの問題があります。剣道UIグリッドデータソースとREST API
Unknown DataSource transport type 'json'. Verify that registration scripts for this type are included after Kendo UI on the page.
kendo.all.js:6621 Uncaught TypeError: Cannot read property 'slice' of undefined
私は剣道UIグリッドとデータソースのドキュメントを確認しましたし、私の知る限り、すべてが(正しいですが、グリッドが移入されていないので、明らかにそれはありませんどんなデータでも)。ここで
は、Webページのコードです: http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-type JSONによると、<!DOCTYPE html>
<html>
<head>
<title>Kendo UI DataSource Proof of Concept</title>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2016.1.412/styles/kendo.common.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2016.1.412/styles/kendo.bootstrap.min.css" />
</head>
<body style="margin:100px">
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="http://cdn.kendostatic.com/2016.1.412/js/kendo.all.min.js"></script>
<div class="panel panel-default">
<div class="panel-body">
<div id="grid"></div>
</div>
</div>
<script>
$(document).ready(function() {
$('#grid').kendoGrid({
dataSource: {
autoSync: true,
type: 'json',
transport: {
read: {
url: 'http://cors.io/?u=http://api.lifestylesdiscovery.com/api/evaluation/test/salecomps',
dataType: 'json',
type: 'GET'
}
},
schema: {
data: 'rows'
}
},
columns: [
{ field: 'Street' },
{ field: 'Subdivision' },
{ field: 'Beds' }
]
});
})
</script>
</body>
</html>
剣道はjQuery 2.xと互換性がありますか? – whipdancer