Skip to content
docsv0.1.0

DataTableComponent

Selectable dashboard data table primitive — row selection, sorting, and pagination state, driven entirely by server-rendered `columns`/`rows` props (no client-side data fetching). The one dashboard primitive besides {@see MetricCardComponent} that overrides {@see mount()} and {@see handle()} instead of just {@see AbstractDashboardComponent::meta()}.

DataTableComponent::contract()

public static function contract(): Milpa\Live\ValueObjects\ComponentContract

This primitive's runtime contract: selection/sort/page state, six actions.

DataTableComponent::mount()

public function mount(array $props, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\StateSnapshot

Builds the initial selection/sort/page state from props, and captures the (normalized) `columns`/`rows`/`selectable`/`persistKey` props as mount-time meta the table's actions do not rewrite.

Parameters

Parameters of mount()
NameTypeDescription
$propsarray
$contextMilpa\Live\ValueObjects\ComponentContext

DataTableComponent::handle()

public function handle(Milpa\Live\ValueObjects\InteractionRequest $request): Milpa\Live\ValueObjects\InteractionResult

Dispatches to the six declared row-selection/sort/page actions; an unrecognized action is reported via {@see InteractionResult::$errors}.

Parameters

Parameters of handle()
NameTypeDescription
$requestMilpa\Live\ValueObjects\InteractionRequest