问题
I have an Kendo UI scheduler widget on mobile page, which as you can see has a datasource read event.
$("#scheduler").kendoScheduler({
...
dataSource: {
batch: true,
transport: {
read: {
url: "http://mydomain.com/api/Schedule/Tasks_Read",
dataType: "jsonp"
},
...
});
When the read event is called it sends the request as
http://mydomain.com/api/Schedule/Tasks_Read?callback=jQuery1910528280699858442_1396259085815&_=1396259085816
the problem is that when the webapi get method gets the request, the [DataSourceRequest]DataSourceRequest request parameter is null.
[HttpGet]
public DataSourceResult Tasks_Read(
[DataSourceRequest]DataSourceRequest request)
//,DateTime startDate)
{
using (scApp = new ScheduleControllerApplication())
{
...
}
}
Can somebody clue me into why the request parameter is null?
I have a scheduler on a MVC4 page and it works fine and has the same querystring jquery addition.
MY SOLUTION - By no means let this stop you from answering if you have diferent approach. Being that this call was from a mobile source i changed the httpget signature
[HttpGet]
public string Tasks_Read(
string request)
{
using (scApp = new ScheduleControllerApplication())
{
...
}
}
and it worked and returned the 2 jQuery items i was expecting.
来源:https://stackoverflow.com/questions/22758815/kendu-ui-datasource-read-event-has-null-request