Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROU-4900: Issue with OnCellClick when reordering columns #416

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace OSFramework.DataGrid.Configuration.Column {
wordWrap: this.wordWrap,
multiLine: this.multiLine,
dataType: this.dataType,
describedById: this.uniqueId,
editor: this.editor,
width: this.width > 0 ? this.width : null, // when the column's width is not set, the default value should be managed by wijmo
};
Expand Down
1 change: 1 addition & 0 deletions src/OSFramework/DataGrid/Types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace OSFramework.DataGrid.Types {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
dataMap?: any;
dataMapEditor?: wijmo.grid.DataMapEditor;
describedById: string;
isCollapsed?: boolean;
isReadOnly: boolean;
isRequired: boolean;
Expand Down
7 changes: 4 additions & 3 deletions src/Providers/DataGrid/Wijmo/Features/ClickEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ namespace Providers.DataGrid.Wijmo.Feature {
private _raiseCellClickEvent(e: MouseEvent) {
const ht = this._grid.provider.hitTest(e);
if (ht.cellType === wijmo.grid.CellType.Cell) {
const column = this._grid.getColumns()[ht.col];
const columnWidgetId = column.widgetId;
const column = ht.getColumn();
const rowNumber = ht.row;
const binding = column.config.binding;
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 line = _.cloneDeep(this._grid.provider.rows[rowNumber].dataItem);
this._grid.rowMetadata.clear(line);

Expand Down
6 changes: 4 additions & 2 deletions src/Providers/DataGrid/Wijmo/Features/DirtyMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ namespace Providers.DataGrid.Wijmo.Feature {
private _isDirtyCell(row: number, col: number): boolean {
const grid = this._grid.provider;
if (this.hasMetadata(row)) {
const binding = this._grid.provider.columns[col].binding;
const targetColumn = this._grid.getColumn(binding);
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;

//If the grid is autogenerated, not need to check for action columns.
Expand Down
Loading