0
在Telerik的劍道UI 2016 Q2我要創建數據源:劍道數據源 「E未定義」 錯誤
var dat1 = '{"items":[{ name: "Pork", category: "Food", subcategory: "Meat" },{ name: "Pepper", category: "Food", subcategory: "Vegetables" },{ name: "Beef", category: "Food", subcategory: "Meat" }]}';
var dataSource = new kendo.data.DataSource({
data: dat1,
dataType: "json",
schema: {
data: "items"
}
});
dataSource.fetch(function() {
});
但我在Firefox/Firebug的得到這個錯誤
類型錯誤:e是未定義
我知道錯誤是爲"schema: {data:"items"}"
也將dataType更改爲jsonp並具有相同的錯誤。
這是否發生在獲取創建JSON?嘗試爲數據源添加模型或嘗試使用'datasource.read()' – TheUknown
爲什麼要將dat1設置爲字符串? – whipdancer