Skip to content

Data Grid Cell Inspector

Read-only dialog for inspecting exact cell values and resolved column definitions.

  • Auto-installed DialogPlugin: Uses the shared Pro dialog runtime for cell and column inspection.
class DataGridCellInspectorPlugin {
open(options: DataGridCellInspectorOpenOptions<T>): void;
openColumn(options: DataGridColumnInspectorOpenOptions<T>): void;
close(): void;
}

export function createDataGridCellInspectorLocale(
overrides?: Partial<DataGridCellInspectorLocaleText>,
): DataGridCellInspectorLocaleText;

DATA_GRID_CELL_INSPECTOR_LOCALE: {
title: string;
close: string;
closeButton: string;
column: string;
property: string;
rowDimension: string;
sourceIndex: string;
valueType: string;
rawValue: string;
rowData: string;
unavailable: string;
columnTitle: string;
closeColumn: string;
columnDimension: string;
columnIndex: string;
physicalIndex: string;
columnType: string;
readonlyMode: string;
sortOrder: string;
filter: string;
pin: string;
width: string;
minimumWidth: string;
maximumWidth: string;
columnData: string;
enabled: string;
disabled: string;
dynamic: string;
automatic: string;
unpinned: string;
pinStart: string;
pinEnd: string;
};

Human-readable value type that preserves useful JavaScript distinctions.

export function getDataGridCellValueType(value: unknown): string;

JSON-like inspection output that never throws for common non-JSON values or circular row models. It is display text only and is not a round-trip format.

export function serializeDataGridCellInspectorValue(
value: unknown,
options: DataGridCellInspectorSerializationOptions = {},
): string;

export function limitDataGridCellInspectorOutput(
value: string,
options: DataGridCellInspectorSerializationOptions = {},
): string;

interface DataGridCellInspectorContext {
readonly column: ColumnRegular<ColumnProp, T>;
readonly model: T;
readonly value: unknown;
readonly rowType: DimensionRows;
/** Visible row index at invocation time. */
readonly rowIndex: number;
/** Index in the authored source, when it can be resolved. */
readonly sourceIndex?: number
}

interface DataGridColumnInspectorContext {
readonly column: ColumnRegular<ColumnProp, T>;
readonly columnType: DimensionCols;
/** Visible column index inside its pinned or unpinned section. */
readonly columnIndex: number;
/** Index in the resolved column store before visibility projection. */
readonly physicalIndex?: number;
/** Rendered width captured when the context menu opened. */
readonly width?: number
}

interface DataGridCellInspectorLocaleText {
readonly title: string;
readonly close: string;
readonly closeButton: string;
readonly column: string;
readonly property: string;
readonly rowDimension: string;
readonly sourceIndex: string;
readonly valueType: string;
readonly rawValue: string;
readonly rowData: string;
readonly unavailable: string;
readonly columnTitle: string;
readonly closeColumn: string;
readonly columnDimension: string;
readonly columnIndex: string;
readonly physicalIndex: string;
readonly columnType: string;
readonly readonlyMode: string;
readonly sortOrder: string;
readonly filter: string;
readonly pin: string;
readonly width: string;
readonly minimumWidth: string;
readonly maximumWidth: string;
readonly columnData: string;
readonly enabled: string;
readonly disabled: string;
readonly dynamic: string;
readonly automatic: string;
readonly unpinned: string;
readonly pinStart: string;
readonly pinEnd: string
}

interface DataGridCellInspectorSerializationOptions {
readonly maxDepth?: number;
readonly maxEntries?: number;
readonly maxStringLength?: number;
readonly maxOutputLength?: number
}

export type DataGridCellInspectorSerializeContext<T extends DataType = DataType> =
| {
readonly kind: 'cell' | 'row';
readonly context: DataGridCellInspectorContext<T>;
}
| {
readonly kind: 'column';
readonly context: DataGridColumnInspectorContext<T>;
};

interface DataGridCellInspectorConfig {
/** Includes enumerable row fields. Off by default to avoid exposing hidden model data. */
readonly includeRowData?: boolean;
/** Includes the resolved column definition. Off by default because it can contain application metadata. */
readonly includeColumnData?: boolean;
readonly localeText?: Partial<DataGridCellInspectorLocaleText>;
readonly serialization?: DataGridCellInspectorSerializationOptions;
/** Application-owned redaction hook applied before bounded serialization. */
readonly redact?: (
value: unknown,
context: DataGridCellInspectorSerializeContext<T>,
) => unknown
}

DataGridCellInspectorOpenOptions (Extended from index.ts)

Section titled “DataGridCellInspectorOpenOptions (Extended from index.ts)”
interface DataGridCellInspectorOpenOptions {
readonly context: DataGridCellInspectorContext<T>;
readonly returnFocus?: HTMLElement
}

DataGridColumnInspectorOpenOptions (Extended from index.ts)

Section titled “DataGridColumnInspectorOpenOptions (Extended from index.ts)”
interface DataGridColumnInspectorOpenOptions {
readonly context: DataGridColumnInspectorContext<T>;
readonly returnFocus?: HTMLElement
}

export function createDataGridCellInspectorView<T extends DataType = DataType>(
document: Document,
options: DataGridCellInspectorOpenOptions<T>,
locale: DataGridCellInspectorLocaleText,
): HTMLElement;

export function createDataGridColumnInspectorView<T extends DataType = DataType>(
document: Document,
options: DataGridColumnInspectorOpenOptions<T>,
locale: DataGridCellInspectorLocaleText,
): HTMLElement;

export function createInspectorContent(document: Document): HTMLElement;

export function createInspectorDetails(document: Document): HTMLDListElement;

export function appendInspectorDetail(
parent: HTMLDListElement,
label: string,
value: string,
): void;

export function createInspectorValueSection(
document: Document,
label: string,
value: unknown,
serialization?: DataGridCellInspectorSerializationOptions,
): HTMLElement;

export function displayInspectorColumnName(column: { name?: unknown; prop: PropertyKey }): string;

export function displayInspectorProperty(prop: PropertyKey): string;

export function readInspectorDataProperty(
target: object,
property: PropertyKey,
): unknown;