Skip to content

Commit

Permalink
ROU-11034: Fixed error in console when clicking a cell on autogenerat…
Browse files Browse the repository at this point in the history
…ed Grids (#432)

This PR is to fix an error in the console when clicking a cell on
autogenerated Grids using JSON Serialize.

### What was happening
* Error in the console when clicking a cell on autogenerated Grids using
JSON Serialize.

![image](https://github.com/user-attachments/assets/959e42dc-3ac4-44d9-bffd-bc320b363453)


### What was done
* In the method `_raiseCellClickEvent` created a fallback using the
`binding` instead of getting the column that is `undefined` in this
scenario.

### Test Steps
1. Go to a screen containing an autogenerated Grid using JSON Serialize.
2. Click any cell with the dev tools console opened
3. Checked that no error is thrown


### Checklist
* [X] tested locally
* [X] documented the code
* [X] clean all warnings and errors of eslint
* [ ] requires changes in OutSystems (if so, provide a module with
changes)
* [ ] requires new sample page in OutSystems (if so, provide a module
with changes)
  • Loading branch information
gnbm authored Aug 27, 2024
2 parents 0844059 + c4e847c commit cd000fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Providers/DataGrid/Wijmo/Features/ClickEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Providers.DataGrid.Wijmo.Feature {
const rowNumber = ht.row;
const binding = column.binding;
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 columnWidgetId = this._grid.getColumn(uniqueId)?.widgetId || binding; // if no column exists (in the case of autogenerated columns using JSONSerialize), then use the binding
const line = _.cloneDeep(this._grid.provider.rows[rowNumber].dataItem);
this._grid.rowMetadata.clear(line);

Expand Down

0 comments on commit cd000fb

Please sign in to comment.