Skip to content

Commit

Permalink
make sure ag grid viewportrowmodel rebuilds reberse column lookup (#1332
Browse files Browse the repository at this point in the history
)
  • Loading branch information
heswell committed May 13, 2024
1 parent a28f605 commit 1d571a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Expand Up @@ -85,6 +85,7 @@ export class ViewportRowModelDataSource {
if (itemsOrOrderChanged(this.columns, columns)) {
this.columns = columns;
this.columnMap = buildColumnMap(columns);
this.reverseColumnMap = reverseColumnMap(this.columnMap);
}
}
};
Expand Down
Expand Up @@ -6,6 +6,7 @@ import {
DataSourceFilter,
DataSourceRow,
DataSourceStatus,
DataSourceSubscribedMessage,
MenuRpcResponse,
Selection,
SubscribeCallback,
Expand Down Expand Up @@ -216,13 +217,15 @@ export class ArrayDataSource
};
}

this.clientCallback?.({
const subscribedMessage: DataSourceSubscribedMessage = {
...config,
type: "subscribed",
clientViewportId: this.viewport,
range: this.#range,
tableSchema: this.tableSchema,
});
};
this.clientCallback?.(subscribedMessage);
this.emit("subscription-open", subscribedMessage);

if (hasConfigProps) {
// invoke setter to action config
Expand Down
1 change: 1 addition & 0 deletions vuu-ui/packages/vuu-data-remote/src/vuu-data-source.ts
Expand Up @@ -191,6 +191,7 @@ export class VuuDataSource
this.#status = "subscribed";
this.tableSchema = message.tableSchema;
this.clientCallback?.(message);
this.emit("subscription-open", message);
} else if (message.type === "disabled") {
this.#status = "disabled";
} else if (message.type === "enabled") {
Expand Down
1 change: 1 addition & 0 deletions vuu-ui/packages/vuu-data-types/index.d.ts
Expand Up @@ -339,6 +339,7 @@ export type DataSourceEvents = {
optimize: (optimize: OptimizeStrategy) => void;
range: (range: VuuRange) => void;
resize: (size: number) => void;
"subscription-open": (subscription: DataSourceSubscribedMessage) => void;
};

/**
Expand Down

0 comments on commit 1d571a1

Please sign in to comment.