Skip to content
Draft
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Dockerfile for starting up a deephaven-server with these latest plugins built and installed
# Expects to be run from the root of the deephaven-plugins repo
# First lets build and install the JS plugins
FROM node:20.13.1 AS base
FROM node:24.10.0 AS base
WORKDIR /work/

# Update packages list and install python python
Expand Down
6 changes: 3 additions & 3 deletions plugins/ag-grid/src/js/src/components/AgGridView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type AgGridViewProps = {
/** Settings controlling the formatting of the data */
settings?: Settings;

/** Other props to pass through to the `AgGridReact` component */
/** Other props to pass through to the `AgGridReact` component. Can override existing props. */
agGridProps?: AgGridReactProps;
};

Expand Down Expand Up @@ -165,8 +165,6 @@ export function AgGridView({

return (
<AgGridReact
// eslint-disable-next-line react/jsx-props-no-spreading
{...agGridProps}
onGridReady={handleGridReady}
onFirstDataRendered={handleFirstDataRendered}
onGridSizeChanged={handleGridSizeChanged}
Expand All @@ -178,6 +176,8 @@ export function AgGridView({
// With a regular table, the row IDs are just the row indices, so we don't need to specify getRowId
getRowId={isTable(table) ? undefined : getRowId}
sideBar={sideBar}
// eslint-disable-next-line react/jsx-props-no-spreading
{...agGridProps}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { dh as DhType } from '@deephaven/jsapi-types';
import type { dh as CorePlusDhType } from '@deephaven-enterprise/jsapi-coreplus-types';
import { TableUtils } from '@deephaven/jsapi-utils';
import {
AdvancedFilterModel,
ColumnGroupOpenedEvent,
ColumnRowGroupChangedEvent,
ColumnValueChangedEvent,
Expand Down Expand Up @@ -204,7 +205,9 @@ export class DeephavenViewportDatasource implements IViewportDatasource {
private handleFilterChanged(event: FilterChangedEvent): void {
log.debug('Filter changed', event);
this.queueOperation(async () => {
this.applyFilter(this.gridApi.getFilterModel());
const filterModel = this.gridApi.getFilterModel();
const advancedFilterModel = this.gridApi.getAdvancedFilterModel();
this.applyFilter(filterModel, advancedFilterModel);
this.refreshViewport();
});
}
Expand Down Expand Up @@ -355,18 +358,44 @@ export class DeephavenViewportDatasource implements IViewportDatasource {
this.table.applySort(AgGridSortUtils.parseSortModel(this.table, sortModel));
}

private applyFilter(filterModel: FilterModel): void {
private applyFilter(
filterModel: FilterModel,
advancedFilterModel: AdvancedFilterModel | null = null
): void {
if (isPivotTable(this.table)) {
throw new Error('Pivot table filter not yet implemented.');
}
log.debug('Applying filter', filterModel);
this.table.applyFilter(
AgGridFilterUtils.parseFilterModel(
log.debug('Applying filter', filterModel, advancedFilterModel);

const filters = [];

// Parse regular filter model
const regularFilters = AgGridFilterUtils.parseFilterModel(
this.dh,
this.table,
filterModel
);
if (regularFilters.length > 0) {
filters.push(...regularFilters);
}

// Parse advanced filter model
if (advancedFilterModel != null) {
const advancedFilter = AgGridFilterUtils.parseAdvancedFilterModel(
this.dh,
this.table,
this.gridApi.getFilterModel()
)
);
advancedFilterModel
);
filters.push(advancedFilter);
}

// Combine all filters with AND logic
const combinedFilter =
filters.length === 0
? []
: [filters.reduce((acc, filter) => acc.and(filter))];

this.table.applyFilter(combinedFilter);
}

private applyViewport(firstRow: number, lastRow: number): void {
Expand Down
Loading
Loading