Hi
I'm using the popup editor to edit rows in the grid.
I'm using following javascript method to open the popup:
function editSelectedRow(name) { var grid = $('#' + name).data('kendoGrid'); var rows = grid.select(); grid.editRow(rows[0]); }
This function is called when a row is double clicked:
$("#Binders tbody").on("dblclick", "tr[role='row']", function (e) { editSelectedRow("Binders"); });
I have this code for many years now and it was never a problem.
With the latest version of the grid this code fails (the popup doesn't open) upon making a change in the popup window. As long as no changes is done to the record in the popup, there will not be a problem.
The error received is the following:
jquery-3.7.1.min.js:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'id') TypeError: Cannot read properties of undefined (reading 'id')
at HTMLTableRowElement.<anonymous> (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1814199)
at Function.each (https://code.jquery.com/jquery-3.7.1.min.js:2:3129)
at Le.fn.init.each (https://code.jquery.com/jquery-3.7.1.min.js:2:1594)
at init._persistSelectedRows (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1814160)
at init.select (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1811103)
at init._displayRow (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1779176)
at https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1894615
at Array.forEach (<anonymous>)
at init.refresh (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:1894600)
at init.trigger (https://kendo.cdn.telerik.com/2024.1.319/js/kendo.all.min.js:9:4189) undefined
When the data in the grid is refreshed, no error will occur anymore.
HOWEVER... I also have an "Edit" button on the toolbar of the grid. That buttons uses the same 'editSelectedRow' function but when that button is used, the popup window will open, even after a change to the record!!
With other words... something goes wrong when double clicking a row after an update was made.
What has changed?
Best regards,
Peter