JSONP:
I am using this data source for a Kendo Chart, but a similar setup did not work for a Kendo Grid as well.
I am using a WCF service, cross domain, and it is a restful service for the JSONP implementation.
I see the response JSONP data in fiddler, but nothing gets displayed in the Kendo chart. I use almost the same setup with JSON and it works fine. (See "JSON" section below for my JSON implementation)
JSONP data source:
dataSource = new kendo.data.DataSource({
transport: {
read: {
cache: false,
url: "http://localhost/BusinessAgingReportJsonP/RestServiceImplJsonP.svc/BusinessAgingCount",
dataType: jsonp,
jsonpCallback: "JsonPCallBack"
}
},
schema: {
type: "jsonp",
data: "BusinessAgingCountResult",
model: {
fields: { BusinessAgingCount: "text()" }
}
}
})
URL: http://localhost/BusinessAgingReportJsonP/RestServiceImplJsonP.svc/BusinessAgingCount
Response Data from the service: JsonPCallBack( {"BusinessAgingCountResult":[0,0,0,3,0,1,1,6]} );
////////////////////////////////////////////////////////////////////////////////////////////////////////////
JSON:
The setup for JSON is almost the same as that for JSONP above, except the JSON implementation works and the JSONP implementation does not work. What am I doing wrong?
JSON data source:
dataSource = new kendo.data.DataSource({
transport: {
read: {
cache: false,
url: "RestServiceImpl.svc/BusinessAgingCount",
dataType: json
}
},
schema: {
type: "json",
data: "BusinessAgingCountResult",
model: {
fields: { BusinessAgingCount: "text()" }
}
}
})
URL: RestServiceImpl.svc/BusinessAgingCount
Response Data from the service: {"BusinessAgingCountResult":[0,0,0,3,0,1,1,6]}
I am using this data source for a Kendo Chart, but a similar setup did not work for a Kendo Grid as well.
I am using a WCF service, cross domain, and it is a restful service for the JSONP implementation.
I see the response JSONP data in fiddler, but nothing gets displayed in the Kendo chart. I use almost the same setup with JSON and it works fine. (See "JSON" section below for my JSON implementation)
JSONP data source:
dataSource = new kendo.data.DataSource({
transport: {
read: {
cache: false,
url: "http://localhost/BusinessAgingReportJsonP/RestServiceImplJsonP.svc/BusinessAgingCount",
dataType: jsonp,
jsonpCallback: "JsonPCallBack"
}
},
schema: {
type: "jsonp",
data: "BusinessAgingCountResult",
model: {
fields: { BusinessAgingCount: "text()" }
}
}
})
URL: http://localhost/BusinessAgingReportJsonP/RestServiceImplJsonP.svc/BusinessAgingCount
Response Data from the service: JsonPCallBack( {"BusinessAgingCountResult":[0,0,0,3,0,1,1,6]} );
////////////////////////////////////////////////////////////////////////////////////////////////////////////
JSON:
The setup for JSON is almost the same as that for JSONP above, except the JSON implementation works and the JSONP implementation does not work. What am I doing wrong?
JSON data source:
dataSource = new kendo.data.DataSource({
transport: {
read: {
cache: false,
url: "RestServiceImpl.svc/BusinessAgingCount",
dataType: json
}
},
schema: {
type: "json",
data: "BusinessAgingCountResult",
model: {
fields: { BusinessAgingCount: "text()" }
}
}
})
URL: RestServiceImpl.svc/BusinessAgingCount
Response Data from the service: {"BusinessAgingCountResult":[0,0,0,3,0,1,1,6]}