@@ -30,6 +30,7 @@ import {
3030import {
3131 InputFilterEvent ,
3232 useDashboardColumnFilters ,
33+ useGridLinker ,
3334} from '@deephaven/dashboard-core-plugins' ;
3435import { useLayoutManager , useListener } from '@deephaven/dashboard' ;
3536import { useApi } from '@deephaven/jsapi-bootstrap' ;
@@ -294,6 +295,14 @@ export function UITable({
294295 model . setColorMap ( colorMap ) ;
295296 }
296297
298+ const {
299+ alwaysFetchColumns : linkerAlwaysFetchColumns ,
300+ columnSelectionValidator,
301+ isSelectingColumn,
302+ onColumnSelected,
303+ onDataSelected,
304+ } = useGridLinker ( model , irisGrid ) ;
305+
297306 const [ dehydratedState , setDehydratedState ] = usePersistentState <
298307 ( DehydratedIrisGridState & DehydratedGridState ) | undefined
299308 > ( undefined , { type : 'UITable' , version : 1 } ) ;
@@ -396,8 +405,15 @@ export function UITable({
396405 } , [ alwaysFetchColumnsProp , columns , throwError ] ) ;
397406
398407 const alwaysFetchColumns = useMemo (
399- ( ) => [ ...alwaysFetchColumnsPropArray , ...formatColumnSources ] ,
400- [ alwaysFetchColumnsPropArray , formatColumnSources ]
408+ ( ) => [
409+ // Deduplicate alwaysFetchColumns
410+ ...new Set ( [
411+ ...alwaysFetchColumnsPropArray ,
412+ ...formatColumnSources ,
413+ ...linkerAlwaysFetchColumns ,
414+ ] ) ,
415+ ] ,
416+ [ alwaysFetchColumnsPropArray , formatColumnSources , linkerAlwaysFetchColumns ]
401417 ) ;
402418
403419 const mouseHandlers = useMemo (
@@ -585,6 +601,10 @@ export function UITable({
585601 model = { model }
586602 onStateChange = { onStateChange }
587603 onSelectionChanged = { debouncedHandleSelectionChanged }
604+ columnSelectionValidator = { columnSelectionValidator }
605+ isSelectingColumn = { isSelectingColumn }
606+ onColumnSelected = { onColumnSelected }
607+ onDataSelected = { onDataSelected }
588608 // eslint-disable-next-line react/jsx-props-no-spreading
589609 { ...mergedIrisGridProps }
590610 inputFilters = { inputFilters }
0 commit comments