diff --git a/js/ui/grid_core/ui.grid_core.editing.js b/js/ui/grid_core/ui.grid_core.editing.js index 8e6c1abc6893..d31afedf81e2 100644 --- a/js/ui/grid_core/ui.grid_core.editing.js +++ b/js/ui/grid_core/ui.grid_core.editing.js @@ -1308,12 +1308,12 @@ const EditingController = modules.ViewController.inherit((function() { const dataController = this._dataController; const item = dataController.items()[rowIndex]; const key = item && item.key; - const editIndex = getIndexByKey(key, this._editData); const oldEditRowIndex = this._getVisibleEditRowIndex(); const isBatchMode = this.option('editing.mode') === EDIT_MODE_BATCH; this.refresh(); + const editIndex = getIndexByKey(key, this._editData); if(editIndex >= 0) { if(this._editData[editIndex].type === DATA_EDIT_DATA_INSERT_TYPE) { this._removeEditDataItem(editIndex); diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js index 210f0f89ac21..252459707450 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js @@ -5036,6 +5036,34 @@ QUnit.test('deleteRow should works if cell value is changed', function(assert) { assert.strictEqual(testElement.find('input').length, 0, 'no editors'); }); +QUnit.test('deleteRow should works in row editing mode if boolean column and validation are exist (T865833, T864931)', function(assert) { + // arrange + const that = this; + const rowsView = this.rowsView; + const testElement = $('#container'); + + that.options.editing = { + mode: 'row', + allowDeleting: true + }; + + that.options.columns.push({ dataField: 'booleanField', dataType: 'boolean', validationRules: [{ type: 'required' }] }); + that.columnsController.reset(); + that.editingController.init(); + + rowsView.render(testElement); + + // assert + assert.strictEqual(testElement.find('.dx-data-row').length, 7, 'row count'); + + // act + that.deleteRow(1); + that.clock.tick(); + + // assert + assert.strictEqual(testElement.find('.dx-data-row').length, 6, 'row is removed'); +}); + // T804894 QUnit.test('addRow should not work if updating is started with validation error', function(assert) { // arrange