Skip to content

Commit d1fba8f

Browse files
authored
feat: Make grid widget respect global formatter settings (#1995)
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.
1 parent c922f87 commit d1fba8f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import {
77
IrisGridModelFactory,
88
type IrisGridModel,
99
} from '@deephaven/iris-grid';
10+
import { useSelector } from 'react-redux';
11+
import { getSettings, RootState } from '@deephaven/redux';
1012

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

1720
const { fetch } = props;
@@ -33,7 +36,7 @@ export function GridWidgetPlugin(
3336
};
3437
}, [dh, fetch]);
3538

36-
return model ? <IrisGrid model={model} /> : null;
39+
return model ? <IrisGrid model={model} settings={settings} /> : null;
3740
}
3841

3942
export default GridWidgetPlugin;

0 commit comments

Comments
 (0)