From 486a4afa386162ef7b236eae53623399b12d87b2 Mon Sep 17 00:00:00 2001 From: Alyar Date: Wed, 8 Nov 2023 13:34:08 +0400 Subject: [PATCH] DataGrid: Fix the "Cannot read properties of undefined (reading 'selector')" error occurs when a column's dataField is not specified and repaintChangesOnly is enabled in popup edit mode (T1198534) (#25967) Co-authored-by: Alyar <> --- .../grid_core/editing/m_editing_form_based.ts | 2 +- .../editing.tests.js | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/js/__internal/grids/grid_core/editing/m_editing_form_based.ts b/js/__internal/grids/grid_core/editing/m_editing_form_based.ts index e33c3a960e44..6b0a8753f33e 100644 --- a/js/__internal/grids/grid_core/editing/m_editing_form_based.ts +++ b/js/__internal/grids/grid_core/editing/m_editing_form_based.ts @@ -318,7 +318,7 @@ const editingControllerExtender = (Base: ModuleType) => class } getFormEditorTemplate(cellOptions, item) { - const column = this.component.columnOption(item.dataField); + const column = this.component.columnOption(item.name || item.dataField); return (options, container) => { const $container = $(container); diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js index b2e7a9d78278..33a732c078df 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js @@ -19835,6 +19835,28 @@ QUnit.module('Editing - "popup" mode', { // assert assert.equal(spy.callCount, 1, 'Edit form has repainted only once'); }); + + // T1198534 + QUnit.test('No exceptions on editing row whene there is unbound column', function(assert) { + // arrange + this.options.repaintChangesOnly = true; + this.columns.push({ name: 'test' }); + this.setupModules(this); + this.renderRowsView(); + + try { + // act + this.editRow(0); + this.clock.tick(10); + + // assert + this.preparePopupHelpers(); + assert.ok(this.isEditingPopupVisible(), 'Edit popup is visible'); + } catch(e) { + // assert + assert.ok(false, 'exception'); + } + }); }); QUnit.module('Promises in callbacks and events', {