Skip to content

Commit

Permalink
feat: Make grid widget respect global formatter settings (#1995)
Browse files Browse the repository at this point in the history
Fixes deephaven/deephaven-plugins#435

Does not fix the issue in embed-widget. I think that should be a
separate ticket. I'll keep
#1964 open for tracking
that if that seems fine

Tested by creating a dh.ui component that included a table and then
changed the formatter settings. Tried global column formats too (the
formats for specifically named columns)

Looks like ui.table already loads these settings, so this will fix for
normal tables.
  • Loading branch information
mattrunyon authored May 9, 2024
1 parent c922f87 commit d1fba8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import {
IrisGridModelFactory,
type IrisGridModel,
} from '@deephaven/iris-grid';
import { useSelector } from 'react-redux';
import { getSettings, RootState } from '@deephaven/redux';

export function GridWidgetPlugin(
props: WidgetComponentProps<dh.Table>
): JSX.Element | null {
const dh = useApi();
const settings = useSelector(getSettings<RootState>);
const [model, setModel] = useState<IrisGridModel>();

const { fetch } = props;
Expand All @@ -33,7 +36,7 @@ export function GridWidgetPlugin(
};
}, [dh, fetch]);

return model ? <IrisGrid model={model} /> : null;
return model ? <IrisGrid model={model} settings={settings} /> : null;
}

export default GridWidgetPlugin;

0 comments on commit d1fba8f

Please sign in to comment.