I'm using the Kendo grid to display Elmah errors (test project to evaluate Kendo UI) from a remote data source that gets JSON data from an MVC application.
I've put a calendar control on the form to filter the data. However, I can't seem to get the read operation to send the parameters. Can anybody figure out what I'm doing wrong? Here is the code:
I've put a calendar control on the form to filter the data. However, I can't seem to get the read operation to send the parameters. Can anybody figure out what I'm doing wrong? Here is the code:
var
errSrc =
new
kendo.data.DataSource({
transport: {
read: {
url:
'@Url.Content("~/Errors")'
,
dataType:
'json'
,
type:
'post'
,
data:
function
() {
var
d = { day: model.date() };
return
d;
}
}
},
schema: {
parse:
function
(data) {
if
(data.length > 1000) {
data = data.slice(0, 1000);
model.tooMany(
true
);
}
var
errs = $.map(data,
function
(item) {
return
new
Error(item) });
model.errors(errs);
model.count(errs.length);
return
model.errors();
}
}
});
I have confirmed that the data function is getting called and the correct date is being returned. However, no data is being sent in the HTTP post (confirmed using Fiddler2).
I've tried a couple different approaches (such as calling errSrc.read({ day: model.date() })) but haven't gotten it to work yet.