I used the solution (slightly modified for my use case) referenced in the docs to add a new row when tabbing out of the last editable column in the last row. However, when the new row is added, the changes made to that last editable cell are lost. How do I prevent that from happening?
Here's my code. The "return false;" was necessary to prevent the focus going to the second column of the new row. The undesired behavior is occurring whether or not I include it.
$(document).ready(
function
() {
var
grid = $(
"#ReceivingReportGrid"
).data(
"kendoGrid"
);
grid.tbody.on(
"keydown"
,
function
(e) {
if
(e.keyCode == 9) {
if
($(e.target).closest(
'td'
).is(
':nth-last-child(2)'
) && $(e.target).closest(
'tr'
).is(
':last-child'
)) {
grid.addRow();
return
false
;
}
}
});
});