[英]Populating A Kendo UI Grid With A JSON String
I'm using a Kendo UI Grid and can't get it to show data when using a JSON string. 我使用的是Kendo UI网格,使用JSON字符串时无法显示数据。 I created a fiddle here.
我在这里制造了一个小提琴。 What am I doing wrong?
我究竟做错了什么?
<script type="text/javascript">
$(document).ready(function ()
{
$('#grid').kendoGrid(
{
scrollable: false,
data: '{"TestHeader":"This is some test data"}',
columns: [ { field: 'TestHeader' } ]
});
});
</script>
<div id="grid"></div>
This might be closer to what you want (note the changes to the data definition): 这可能更接近您想要的内容(请注意对数据定义的更改):
$(document).ready(function ()
{
$('#grid').kendoGrid(
{
scrollable: false,
dataSource: { data: [ { "TestHeader": "This is some test data"} ] },
columns: [ { field: 'TestHeader' } ]
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.