Skip to content

Commit

Permalink
Fix implementation on editing.changes accumulating
Browse files Browse the repository at this point in the history
Fixed an issue where the editing.changes array in the Grid was not cleared for newly-added rows that were subsequently deleted. This caused validation to fail as the deleted row's changes remained in the array, even though it was no longer displayed.
  • Loading branch information
PaulDevExpress committed Dec 26, 2024
1 parent 0d1a47f commit c31f2e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ASP.NET Core/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script>
function validateVisibleRows() {
const grid = $("#gridContainer").dxDataGrid("instance");
const currentChanges = grid.option('editing.changes').filter(c => Object.keys(c.data).length > 0);
const currentChanges = grid.option('editing.changes').filter((c) => Object.keys(c.data).length > 0);
const fakeChanges = grid.getVisibleRows().map(function (row) {
return { type: "update", key: row.data.ID, data: {} };
});
Expand Down
2 changes: 1 addition & 1 deletion jQuery/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $(() => {

function validateVisibleRows() {
const grid = $('#gridContainer').dxDataGrid('instance');
const currentChanges = grid.option('editing.changes').filter(c => Object.keys(c.data).length > 0);
const currentChanges = grid.option('editing.changes').filter((c) => Object.keys(c.data).length > 0);
const fakeChanges = grid.getVisibleRows().map((row) => ({ type: 'update', key: row.key, data: {} }));

grid.option('editing.changes', [...currentChanges, ...fakeChanges]);
Expand Down

0 comments on commit c31f2e4

Please sign in to comment.