We are trying to add extra data to a grid via an onscroll listener.
This works when the data is filtered or sorted, but not when grouped.
Below is the code we currently have that is called when new data is needed.
var grid = $("#grid").data("kendoGrid");
var parameterMap = grid.dataSource.transport.parameterMap;
var requestObject = parameterMap({ aggregate:grid.dataSource.aggregate(),sort: grid.dataSource.sort(), filter: grid.dataSource.filter(), group: grid.dataSource.group(), page: pagina, pageSize:grid.dataSource.pageSize() });
$.post('@Url.Action("GetAllOffers_Post", "Offer")', requestObject, function (response) {
try {
grid.dataSource.pushCreate(response.Data); //Works for non-grouped data
} catch (err) {
console.log(err);
try {
//Data is grouped when we end up here
//var data = grid.dataSource.schema.parse(response.Data);
//Array.prototype.push.apply(grid.dataSource.options.schema.groups, response.Data); //API said we could use the schema.parse but that doesn't work nor does the schema.groups since grid.dataSource.schema doesn't exist
} catch (errortwee) {
console.log(errortwee);
}
}