Skip to content

Commit

Permalink
feat: Make grid widget respect global formatter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed May 8, 2024
1 parent bb23671 commit c6e3c1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 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,17 @@ 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<
RootState,
RootState['workspace']['data']['settings']
>(getSettings);
const [model, setModel] = useState<IrisGridModel>();

const { fetch } = props;
Expand All @@ -33,7 +39,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 c6e3c1a

Please sign in to comment.