0
저는 이미 많은 기사를 telerik 사이트에서 검색 한 바 있지만 아직 내 데이터가로드되지 않는 문제를 계속 실행하고 있습니다. 여기 Kendo Grid가 원격 JSON 데이터를로드하지 않습니다
은 JS의 검도 그리드입니다 : - :일반 내가 MVC 웹 API를 공격하려고 해요
$("#ss-address-book-grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: "http://localhost:65257/InternalDirect/GetAddresses"
},
schema: {
model: {
fields: {
alias: { type: "string" },
full_address: { type: "string" }
}
}
}
},
sortable: true,
columns:
[
{
field: "full_address",
title: "Address"
},
{
field: "alias",
title: "Alias"
}
]
});
호출하고 성공적으로 수신 된 응답하고 올바른 형식 :
Request URL:http://localhost:65257/InternalDirect/GetAddresses
Request Method:GET
Status Code:200 OK
응답 헤더 :
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Content-Length:125
Content-Type:application/json; charset=utf-8
Date:Mon, 27 Mar 2017 16:21:48 GMT
응답 :
[{"alias":"Test Alias","full_address":"[email protected]"},
{"alias":"Test Alias 2","full_address":"[email protected] 2"}]
UI로드하지 검도 격자; JS 오류가 발생하지 않습니다.
크로스 도메인이기 때문에 응답 헤더에서 Access-Control_Allow_Origin을 볼 수 있습니다. 응답이 올바른 형식 인 것 같습니다.
'type'을 odata 및 jsonp로 변경했습니다. 또한 read 섹션의 데이터 유형을 json/jsonp로 설정했습니다.
누구나이 특정 문제에 대한 아이디어가 있습니까? 나는 데이터 헤더와 ID 정의하는 데 필요한 - -