我有一个网格,它绑定来自 DataSource 的数据,但它不显示数据,我可以看到来自服务器的数据,但网格保持为空,这是我的代码:
var dts = new kendo.data.DataSource({
type: "json",
serverPaging: true,
pageSize: 20,
group: { field: 'ProductType' },
transport: {
read: {
url: "http://someurl.com", // the remove service url
dataType: "json" ,// JSONP (JSON with padding) is required for cross-domain AJAX
type: "GET",
},
parameterMap: function(options) {
return {
//Some parameters
};
}
}
});
var grid = $("#grid").kendoGrid({
dataSource: dts,
navigatable: true,
sortable: true,
audoBind: false,
height: 240,
pageable: false,
scrollable: false,
columns: [
{
field: "SKU",
width: 100,
title: "SKU"
}, {
field: "ItemDescription",
width: 150,
title: "DescriptionDescription"
}, {
field: "Quantity",
width: 80,
title: "QTY"
}, {
field: "UOM",
width: 80,
title: "UOM"
}, {
field: "UnitPrice",
width: 130,
title: "UnitPrice",
format: "{0:c}"
}, {
field: "Tax",
width: 80,
title: "Tax",
format: "{0:c}"
}, {
field: "Total",
width: 80,
title: "Total",
format: "{0:c}"
}
]
}).data("kendoGrid");
dts.read();
这是我的代码,首先创建数据源“dts”,然后创建网格“grid”,最后调用读取函数“dts.read()”。DataSource 从服务器读取数据,但它没有显示在 Grid 上。
任何帮助将不胜感激!