I have a grid that I am loading with a linq query to my database. On page load it works great and returns dated now + 21 days. The users need to ability to then enter there own dates to search between. It is all working great right up to the point the data returned from the controller needs to get into the grid. It just won't load.
Relevent code of grid
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read
.Action(
"Action"
,
"Controller"
)
)
.Sort(sort =>
{
sort.Add(p => p.ID).Ascending();
sort.Add(p => p.Date).Ascending();
})
.Group(g =>
{
g.Add(c => c.ID);
})
.ServerOperation(
false
)
)
When the user enters 2 dates and clicks search the function is run. The grid is cleared and a loading message appears goes away and the grid remains blank.
function
onClickSearch() {
var
fromDate = $(
"#startDate"
).data(
"kendoDatePicker"
).value(),
toDate = $(
"#endDate"
).data(
"kendoDatePicker"
).value();
$(
"#prodReadiGrid"
).data(
"kendoGrid"
).dataSource.read({
"start"
: fromDate,
"end"
: toDate});
}
When I debug I see the controller sending the view the grid, it just does not load.
Any ideas?