I am attempting to create a new, inline editable row on the first page of
our kendo grid. On sort and filter we would like the row to remain on the top
of the grid. It is currently getting shuffled into the table. The code which
created the new row is included below. Full cshtml attached.
//add the new record row if we are on page 1
dataSource.bind("requestEnd", function(e) {
setTimeout(function() {
var grid = $("#grid").data("kendoGrid");
console.log("requestEnd - " + grid.dataSource.hasChanges());
if (grid.dataSource.page() == 1) {
//has an empty row already been added
if(grid.dataSource.hasChanges()) {
grid.dataSource.cancelChanges();
}
newGuy = grid.dataSource.insert(0, { });
grid.editRow($("tr:nth(0)", grid.tbody));
}
});
});
our kendo grid. On sort and filter we would like the row to remain on the top
of the grid. It is currently getting shuffled into the table. The code which
created the new row is included below. Full cshtml attached.
//add the new record row if we are on page 1
dataSource.bind("requestEnd", function(e) {
setTimeout(function() {
var grid = $("#grid").data("kendoGrid");
console.log("requestEnd - " + grid.dataSource.hasChanges());
if (grid.dataSource.page() == 1) {
//has an empty row already been added
if(grid.dataSource.hasChanges()) {
grid.dataSource.cancelChanges();
}
newGuy = grid.dataSource.insert(0, { });
grid.editRow($("tr:nth(0)", grid.tbody));
}
});
});