Skip to content

Commit

Permalink
Fix ClickEvent and DirtyMark for autogenerated columns
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-giulianasilva committed May 20, 2024
1 parent 43a3b73 commit 868c64f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Providers/DataGrid/Wijmo/Features/ClickEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ namespace Providers.DataGrid.Wijmo.Feature {
const column = ht.getColumn();
const rowNumber = ht.row;
const binding = column.binding;
const columnWidgetId = this._grid.getColumn(column.describedById).widgetId;
const uniqueId = column.describedById || binding; // if describedById is undefined (in the case of autogenerated columns), then use the binding
const columnWidgetId = this._grid.getColumn(uniqueId).widgetId;
const line = _.cloneDeep(this._grid.provider.rows[rowNumber].dataItem);
this._grid.rowMetadata.clear(line);

Expand Down
3 changes: 2 additions & 1 deletion src/Providers/DataGrid/Wijmo/Features/DirtyMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace Providers.DataGrid.Wijmo.Feature {
private _isDirtyCell(row: number, col: number): boolean {
const grid = this._grid.provider;
if (this.hasMetadata(row)) {
const columnUniqueId = this._grid.provider.columns[col].describedById;
const columnUniqueId =
this._grid.provider.columns[col].describedById || this._grid.provider.columns[col].binding; // if describedById is undefined (in the case of autogenerated columns), then use the binding
const targetColumn = this._grid.getColumn(columnUniqueId);
const binding = targetColumn.config.binding;
let isActionColumn = false;
Expand Down

0 comments on commit 868c64f

Please sign in to comment.