Skip to content

Commit

Permalink
DataGrid: Fix the "Cannot read properties of undefined (reading 'sele…
Browse files Browse the repository at this point in the history
…ctor')" error occurs when a column's dataField is not specified and repaintChangesOnly is enabled in popup edit mode (T1198534) (#25967)

Co-authored-by: Alyar <>
  • Loading branch information
Alyar666 authored Nov 8, 2023
1 parent ed8e1eb commit 486a4af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const editingControllerExtender = (Base: ModuleType<EditingController>) => 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);
Expand Down
22 changes: 22 additions & 0 deletions testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down

0 comments on commit 486a4af

Please sign in to comment.