Ga naar hoofdinhoud

CnTableWidget

Compact data table with a card wrapper, title header, and optional "View all" footer link. Supports two data modes: external (pass rows directly) or self-fetch (provide register + schemaId to fetch from the OpenRegister API).

Wraps: CnDataTable

Usage

<!-- External data mode -->
<CnTableWidget
title="Related Skills"
:rows="skillRows"
:columns="[
{ key: 'name', label: 'Name' },
{ key: 'level', label: 'Level' },
]"
:limit="5"
:view-all-route="{ name: 'Skills' }"
:row-click-route="(row) => ({ name: 'SkillDetail', params: { id: row.id } })" />

<!-- Self-fetch mode (fetches from OpenRegister) -->
<CnTableWidget
title="Documents"
:register="9"
:schema-id="42"
:limit="5"
:columns="docColumns"
:view-all-route="{ name: 'Documents' }" />

Props

PropTypeDefaultDescription
titleString''Widget title shown in the card header with a total count badge
rowsArraynullExternal row data. When provided, no API calls are made
columnsArray[]Column definitions: [{ key, label, sortable? }]
registerString | NumbernullOpenRegister register ID for self-fetch mode
schemaIdString | NumbernullOpenRegister schema ID for self-fetch mode
limitNumber0Maximum rows to display (0 = unlimited). When total exceeds limit, a "View all" link appears
viewAllRouteObjectnullVue Router route for the "View all" footer link
rowClickRouteFunctionnullFunction (row) => route for row click navigation
viewAllLabelString'View all'"View all" link label
emptyTextString'No data available'Empty state message