Skip to content

Commit

Permalink
[DataGrid] Also send the API with events in Premium (#13893)
Browse files Browse the repository at this point in the history
Co-authored-by: Bilal Shafi <[email protected]>
  • Loading branch information
pcorpet and MBilalShafi authored Jul 25, 2024
1 parent cc66cad commit b795564
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DATA_GRID_PRO_PROPS_DEFAULT_VALUES,
GRID_DEFAULT_LOCALE_TEXT,
DataGridProProps,
GridSignature,
} from '@mui/x-data-grid-pro';
import { computeSlots, useProps } from '@mui/x-data-grid-pro/internals';
import {
Expand All @@ -25,7 +26,7 @@ type GetDataGridProForcedProps = (
) => DataGridProForcedProps;

const getDataGridPremiumForcedProps: GetDataGridProForcedProps = (themedProps) => ({
signature: 'DataGridPremium',
signature: GridSignature.DataGridPremium,
...(themedProps.unstable_dataSource
? {
filterMode: 'server',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export function useGridApiInitialization<
}

const details =
props.signature === GridSignature.DataGridPro
props.signature === GridSignature.DataGridPro ||
props.signature === GridSignature.DataGridPremium
? { api: privateApiRef.current.getPublicApi() }
: {};
privateApiRef.current.eventManager.emit(name, params, event, details);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { GridApiCommon } from '../../models';
enum GridSignature {
DataGrid = 'DataGrid',
DataGridPro = 'DataGridPro',
DataGridPremium = 'DataGridPremium',
}

interface RegistryContainer {
Expand Down

0 comments on commit b795564

Please sign in to comment.