StaticGrid#

@palmyralabs/rt-forms-mantine · grid/StaticGrid.tsx

Overview#

Client-side table. Renders columns against an in-memory rowData array using BaseTable — no server fetching, no pagination infrastructure. Use it for already-loaded result sets, detail drills, and fixture tables.

Signature#

const StaticGrid = forwardRef(function StaticGrid(
  props: StaticGridOptions,
  ref: RefObject<IPageQueryable>,
): JSX.Element);

Props — StaticGridOptions (from @palmyralabs/rt-forms)#

Prop Type Purpose
columns ColumnDefinition[] Column defs (attribute, label, type, cellRenderer, …)
rowData any[] Rows to render
EmptyChild ComponentType? Rendered when rowData is empty
customizer GridCustomizer? Header/footer/cell overrides (defaults to NoopGridCustomizer)
onRowClick (rowData) => void? Per-row click handler
setSortColumns (sort) => void? Client-side sort callback

Ref — IPageQueryable#

Inherited from @palmyralabs/rt-forms. On a StaticGrid only the client-side subset is meaningful (getCurrentData, refresh, setSortColumns); server methods like gotoPage / setQueryLimit are no-ops.

Example#

import { StaticGrid } from '@palmyralabs/rt-forms-mantine';
import type { ColumnDefinition } from '@palmyralabs/rt-forms';

const columns: ColumnDefinition[] = [
  { attribute: 'name',   name: 'name',   label: 'Name' },
  { attribute: 'rating', name: 'rating', label: 'Rating', type: 'NUMERIC' },
];

export function ManufacturerDrillDown({ rows }: { rows: any[] }) {
  return <StaticGrid columns={columns} rowData={rows} onRowClick={r => console.log(r)} />;
}