Skip to main content
Version: v1 (Current)

DataTable Component Documentation

The DataTable component (resources/js/Components/Mod/DataTable.vue) is a highly configurable table component used throughout the GxP platform. It supports multiple display modes, search functionality, filtering, pagination, CRUD operations, and more.

Overview​

The DataTable component is the primary way to display tabular data in the admin dashboard. It can be rendered:

  • As a standalone page via IndexPage.vue
  • As a card within FormCard.vue (type: data_table or data-table)
  • As a form field via FormField.vue (type: data_table or data-table)

DataTables accept configuration objects for headers, options, and create actions. JavaScript definitions can contain functions; serialize only JSON-compatible values when storing configuration as JSON.


Data Loading Modes​

The DataTable supports three data loading modes:

1. Server-Provided Data (via props)​

Data is passed from the Laravel controller via Inertia props:

<IndexPage
:paginated-items="props.data"
:headers="headers"
:options="options"
/>

2. Auto-Fetch from API (Internal Request)​

The component enables internal requests when listData is null or an empty array and options.searchRoute is an object whose requestType is exactly "get" or "post". It fetches on mount unless searchRoute.waitForFetchEvent is truthy.

paginatedItems and options.listKey do not disable this mode. Avoid mixing a server-provided paginator with internal fetching unless that behavior is intentional. A nonempty listData array disables internal requests.

// DataTable auto-fetches when:
// 1. searchRoute.requestType is "get" or "post"
// 2. listData is null or empty
const options = {
searchRoute: {
route: "dashboard.items.index",
params: { project: projectSlug },
requestType: "get", // REQUIRED for auto-fetch
},
}

// This example omits server-provided pagination
<IndexPage
:paginated-items="null"
:headers="headers"
:options="options"
/>

An object without a matching requestType, or a string searchRoute, uses the Inertia visit branch when fetchData is called. That branch calls router.visit with preserveScroll and preserveState; it expects an Inertia page response rather than a JSON paginator. The HTTP branch expects JSON. Choose the mode that matches the endpoint's response contract.

Request and response contract​

For internal GET requests, the payload is sent as query parameters; POST requests send it as the request body. The ordinary HTTP branch stores res.data, or res.data[options.listKey] when a list key is configured. Supply a paginator object with a data row array and pagination metadata such as total, current_page, and per_page, rather than an unrelated response envelope. listKey is a direct property lookup, not a nested dot-path resolver.

The payload includes per_page, page, sort_by, sort_direction, search, and visible_columns. A changed search resets the requested page to 1. Advanced mode removes empty-string/null base values and adds search_mode: "advanced" and condition_groups, then returns before the basic-filter merge. Basic mode retains the base values, applies URL filters when applyFiltersFromUrl is enabled, or custom filters otherwise. Default filters are appended by field only in the custom-filter branch. Inline filters replace existing filters on the same field.

options.extraPayload, when an object, is applied last with Object.assign and can override pagination, search, and filter keys. Do not put trusted permission constraints in browser configuration; authorize and scope every request on the server. Invalid JSON in the URL filters parameter causes the fetch to fail instead of silently ignoring that filter.

If options.stickyState.store.executeSearch exists, it performs the internal request instead of the ordinary HTTP call and receives the URL, payload, method, and list key. A falsy result exits without replacing local data; the component treats this as an aborted search. Successful internal results update local pagination, validate the current page, and call options.onFetchSuccess(data) when supplied. This callback is not used by the Inertia branch.

Named routes resolve through the platform route helper. A string search route is used directly as the destination. An object can supply a route() function; named-route parameter objects are passed to the helper. The projectPlugin form resolves parameter paths from the data model and supplies the active project slug. Array parameter descriptors similarly resolve key from the model or a truthy literal value; falsy literal values in that branch are skipped. Ensure the active project and required route parameters exist before fetching.

3. Static List Data​

For non-paginated static arrays:

{
type: "data_table",
listData: myStaticArray, // Array of objects
headers: [...],
options: {...},
}

Top-level FormCard listKey selects a value from its data model; options.listKey selects a property from the HTTP response. They serve different purposes.

Delayed Fetch (waitForFetchEvent)​

To prevent auto-fetch on mount and wait for an external trigger:

searchRoute: {
route: "dashboard.items.index",
requestType: "get",
waitForFetchEvent: true, // Don't fetch on mount
}
// Later, trigger fetch via event bus:
// globalEventBus.emit("refetch-data")

refetch-data is a shared bus event: every mounted table subscribed to that bus checks its internal-request mode and may fetch. It does not target one table. Use the options.onMounted({ fetchData, updateTableRows }) callback to retain that table’s fetch function when you need a targeted trigger.


Pagination and row ownership​

Choose one row source. A nonempty listData array supplies the current client-side slice. Otherwise internal mode uses localPaginatedData.data; the remaining branch uses paginatedItems.data. The paginator metadata accessor independently prefers a nonempty paginatedItems object over the internal response. Mixing these inputs can therefore display rows and pagination metadata from different responses.

For server pagination, return the Laravel-style paginator fields data, total, current_page, per_page, and last_page. Rows come from data; page count reads last_page and falls back to 1 when omitted. Initial page reads paginatedItems.current_page or 1. Initial page size prefers paginator per_page, then options.defaultItemsPerPage, then the first per-page option. Supply positive page sizes and complete metadata rather than relying on fallback values to describe your dataset.

Internal navigation updates the requested page and invokes fetchData. Server-provided pagination uses an Inertia GET to the current pathname, preserves the hash, merges URL parameters, and preserves scroll/state. It does not use the configured search destination for that navigation. Client-side list navigation avoids an HTTP request; rows are sliced using the current page and page size.

Static-list sorting compares direct row[sort_by] values, with ascending order only for "asc"; it does not resolve nested keys in this sorting branch. Despite its internal name listDataFiltered, that computation sorts and slices without applying text search or backend filter semantics. Filter arrays on the server and static arrays in the browser are separate contracts.

The closest-valid-page helper clamps against ceil(total / per_page) and returns 1 for missing/nonpositive inputs. After a server response leaves an empty page while total is positive, the table attempts to navigate to the last valid page, with a guard against repeating the same correction. An actually empty result set does not trigger that watcher’s correction. options.hidePagination suppresses pagination UI; it does not turn the endpoint into an unpaginated response or fetch every row.


Usage Contexts​

Via IndexPage​

The most common usage for list/index pages:

<template>
<IndexPage
:create-config="createConfig"
:headers="headers"
:options="options"
table-title="Attendees"
:paginated-items="props.data"
/>
</template>

Via FormCard (in ShowPage tabs)​

Used when embedding a DataTable within a Show page:

{
type: "data_table",
tableTitle: "Credential List",
listKey: "credentials", // Key in dataModel containing list data
headers: [...],
options: {...},
createConfig: {...}
}

Using API-Based Data Loading in FormCard​

IMPORTANT: When using searchRoute for API-based data loading in a FormCard context, the searchRoute configuration must be placed inside the options object (not at the top level of the card config):

{
type: "data_table",
tableTitle: "Build History",
// WRONG: searchRoute at top level will not work
// searchRoute: { route: "...", params: {...} },

// CORRECT: searchRoute inside options
options: {
searchRoute: {
route: "dashboard.items.index",
params: { page: pageSlug },
requestType: "get", // REQUIRED for API fetch
},
defaultItemsPerPage: 15,
},
headers: [...],
}

The requestType property is required for the DataTable to make internal API requests via axios. Without it, calls to fetchData use the Inertia visit branch and require an endpoint that returns an Inertia page.

Via FormField​

Used when a DataTable is part of a form:

{
type: "data-table",
tableTitle: "Items",
listData: [...],
headers: [...],
options: {...},
createConfig: {...}
}

Props Reference​

PropTypeRequiredDefaultDescription
tableTitleStringNo""Title displayed above the table
headersArrayYes[]Column definitions for the table
optionsObjectYes{}Table configuration options
paginatedItemsObjectNonullLaravel paginated response object
listDataArrayNonullStatic array sliced locally; nonempty values take precedence over remote rows
createConfigObjectYes{}Configuration for create dialog
itemModelObjectNo{}Additional model data
dataStoreObjectNo{}Pinia data store reference
selectedArrayNo[]Initial selected IDs; later prop replacement is not watched

Headers Definition​

Headers define the columns displayed in the DataTable. Each header is an object with the following properties:

Basic Header Properties​

{
key: "field_name", // Required: Data field key (supports dot notation: "user.name")
title: "Column Title", // Display title
align: "start", // "start" | "center" | "end"
sortable: true, // Enable sorting on this column
width: "100px", // Fixed column width
filter: false, // Used in some contexts
headerClassList: [], // CSS classes for header cell
class: "custom-class", // CSS class for data cells
}

Renderer boundaries​

A header is not a validated universal schema: each row-renderer branch consumes its own properties. Default text and badge formatting use getNestedProperty(item, key) and call format(value, item) when supplied. Boolean, image, time-since, duration, and tags branches directly read item[column.key]; nested paths are therefore not supported uniformly. Provide arrays for tags. A tags transform(tag) takes precedence over textKey, which otherwise resolves a nested path inside each object tag.

Column visibility is driven by the table’s visible-column selection. A nonempty selection filters headers by key while retaining the actions column; an empty selection leaves all headers visible. The table moves an existing actions column to the end and adds a select column when selection is enabled. Do not assume arbitrary visible or hideable header flags enforce visibility.

formatHtml(value, item) feeds v-html directly in the default and inline-edit rendering branches. Return trusted, sanitized markup; ordinary format output is interpolated as text. Hiding or formatting a sensitive field does not remove its value from the browser response.

The cellComponent escape hatch receives item, column, the nested value, and cellProps; it is considered after built-in type branches. It does not supply a generic save listener. A progress_segments column uses segments(item) when callable, otherwise an array at its nested key, with optional colors passed to ProgressSegments.

Built-in inlineEditable cells additionally require options.inlineEdit.enabled; an optional store’s canEditField(fieldSlug || key) can deny editing. This renderer passes item.id as an attendee ID to InlineEditCell. For non-attendee editors, use cellComponent with the appropriate backend contract instead of assuming that enabling inline edit makes any resource editable.

Link column callback shapes differ from row actions. An internal_link column calls route(item) and classList(item) directly; its optional label is also called as a function. An external_link column calls route(item) and accepts function/array classes. Export/download columns likewise call classList(item) and optional label(item); provide functions for those properties. The download column requests its route(item) through the HTTP helper and expects a JSON url for a signed download destination, optionally using the response Content-Disposition filename. It does not treat the initial response as the file bytes.

Column Types​

See the configuration reference for the renderer’s type-specific properties and callback signatures. Use explicit sortable: false on non-sortable columns. A format callback is a display transform, not a sort transform or backend field mapping.

Options Configuration​

Place behavior settings inside options; the configuration reference groups the actual settings by contract. These are JavaScript objects, not a runtime-validated JSON schema. Function-valued callbacks and component references must remain in JavaScript.


Create Configuration​

createConfig describes the create UI and its persistence definition. Set create.route and its route parameters for a real backend endpoint, provide FormCard cards or tabsList, and configure that endpoint’s authorization and validation. The table passes the definition to CreateDialog (or component); it does not infer a resource CRUD API. See FormCard and FormField for the form contracts.

Create lifecycle and type-specific fields​

The table instantiates a create dialog only when the resolved configuration has a truthy create member and is nonempty. component can replace the default CreateDialog. position defaults to "top"; "bottom" places it below the table. The create URL query parameter matches either "1" or the configuration’s identifier. Empty-state opening reads the server paginatedItems.total, so it is not a universal empty-array auto-open rule.

dropdownCreate.options supplies type choices; the search box appears above ten choices and filters trimmed, case-insensitive labels. Closing the menu clears its search. The bare create button resets type-specific state before opening the default form.

For a type choice, dynamicFieldsFetcher(option) can return type data asynchronously; otherwise dynamicFieldsKey reads usePage().props[key][option.value]. Expected data contains type.id and a fields array. Only cards marked dynamicFieldsPlaceholder receive those fields. By default they replace that card’s fields; dynamicFieldsMode: "append" retains its original fields first. The selected type seeds an existing type field or adds a hidden field, using typeIdField or "attendee_type_id" by default.

Async results are guarded by a request ID, so an older selection cannot replace a newer selection’s definition. Each choice clears the previous dynamic configuration before loading. A rejected async fetch logs an error and leaves the default create configuration, including when the change came from an already-open dialog. This does not cancel the network request itself. A synchronous throw from the fetcher occurs before its async-result try/catch. With refetchFieldsOnTypeChange, the matching selector’s inputHook is replaced with the type-refetch hook; map stored IDs to choice values with typeOptionForValue when they differ. That path updates the open definition without reopening and reseeding the dialog; the initial dropdown path can reseed after loading.

staged: true makes CreateDialog emit transformed row data instead of posting it. The table appends it to the parent model array at options.listKey, replaces its ID with a temporary staged identifier, and assigns zero-based order. Local delete/reorder also update that array. The containing form must later save and validate it; closing a dialog alone does not persist these rows. The parent store must already contain an array at dataModel[options.listKey]; missing/non-array values prevent these local operations. Supply the real useDataModelStore, with its reactive dataModel/updatedFields and model initialization/get/set methods, rather than a plain object. For example, initialize a dedicated store with store.initializeDataModel({ items: [] }, [], true) and use options.listKey: "items". Keep a staged table local: combining staging and internal fetching reuses options.listKey for response extraction and parent mutation, and the table does not coordinate a remote dataset with the staged parent array.

Toolbar links and dropdowns use different handlers. A link’s action(router, dataModel) runs directly; otherwise its named route is visited with method || "get". A dropdown item needs route, which may be a function of the link or a named route. The dropdown handler does not execute an arbitrary action member. Their preserveState/preserveScroll use value || true, so passing false does not disable preservation in these handlers.


Actions Configuration​

Edit Action​

Navigates to an edit/show page:

edit: {
route: "dashboard.items.show", // Or supply a function returning the destination URL
key: "item",
params: { project: projectSlug },
icon: "pencil",
tooltip: "Edit",
color: "secondary",
hideOnCard: false,
}

Edit navigation resolves item.slug || item.id. For a named route it adds the identifier under edit.key and combines edit.params with team injection; those parameters can override the generated identifier. A function edit.route(item) returns a URL directly. Ensure route keys match the backend route signature.

Delete Action​

Shows delete confirmation modal:

delete: {
route: "dashboard.items.destroy",
key: "item",
params: { project: projectSlug },
disabled: false,
condition: (item) => item.deletable,
title: "Delete Item",
bodyText: "This action cannot be undone.",
buttonText: "Delete",
successMessage: "Deleted successfully",
errorMessage: "Delete failed",
confirmText: (item) => `DELETE ${item.name}`,
onSuccess: ({ fetchData }) => fetchData(),
}

On a row-delete success, the table calls options.delete.onSuccess({ fetchData, selectedItems }) once unless an active selection-action callback takes precedence. For a bulk-delete success, precedence is active selection-action callback, then options.bulkDelete.onSuccess({ fetchData, selectedItems }), then the delete callback, then an internal refresh. This is separate from the selection action callback’s modal-plus-table double-call limitation below.

For ordinary row deletion, the configured delete.key_type chooses the item property first, falling back to slug and then id. The row-delete modal receives no bulk selection or bulk destination, so existing checked rows do not turn a row delete into a bulk delete. A missing or "#" destination is refused by the confirmation component. When createConfig.staged is enabled, row deletion instead removes the matching ID from the local data-model array at options.listKey, without opening a confirmation or sending a request; saving the containing model remains separate.

Additional Actions​

Custom action buttons in the actions column:

additionalActions: [
// Link action
{
type: "external_link",
url: (item) => item.external_url,
icon: "external-link",
tooltip: "Open External",
condition: (item) => item.has_external_url,
},

// Boolean toggle
{
type: "boolean_icon",
name: "is_active",
icon: "toggle-on",
condition: (item) => item.toggleable,
},

// Download button
{
type: "download_button",
route: (item) => route("items.download", { item: item.id }),
icon: "download",
label: "Download",
},

// Standard button
{
icon: "play",
tooltip: "Process",
color: "success",
classList: ["btn-sm"],
onClick: ({ item, fetchData }) => {
// Run page-owned behavior using this row and refresh explicitly when needed.
},
},
]

Additional row actions are checked against frontend feature/permission and condition helpers. boolean_icon and download_button use the FormField branch; other types emit to the table’s action handler. That handler first runs onClick({ event, item, action, fetchData }) and returns. Otherwise type: "external_link" opens url (a value or row function). Other actions require a callable route(item); transform(item) supplies visit data, and requestType defaults to "get". It preserves scroll/state and supports onStart, onSuccess, and onFinish. No route and no callback means no action. A form-modal type alone does not create an additional-action modal in this handler; use the supported expandable row configuration or an explicit page-owned callback.

These frontend checks control presentation. Every destination still needs server authorization, validation, and project/team scoping.


Selection & Bulk Actions​

Enable Selection​

options: {
selectable: true,
allowSelectAll: true,
hideSelectAllLabel: false,
maxSelection: {
count: 10,
showSelectionCount: true,
},
}

Selection lifetime and store binding​

Give every selectable row a unique id. The checkbox helper initializes from selected and emits update:selected when its selection changes; it does not watch later replacements of the incoming selected prop. The header state compares IDs as strings, is checked only when all visible rows are selected, and is unchecked for an empty page. Selecting all replaces the selection with the current rows’ IDs; it does not select every matching record on the server.

The DataTable wrapper adds pruning beyond the standalone helper: whenever tableRows changes, it removes selected values absent from the new visible rows. That comparison accepts either the row’s id or slug as strings. Do not rely on selection surviving a page change, search, or refresh that removes those rows. singleSelect keeps the last value on subsequent selection assignments; it does not normalize an initial multi-value array.

With options.includeSelectedInDataModel, a dataStore, and a select header containing name, mount reads that field’s array and later selection changes call setModelValue({ name, column }, selectedIds, true). The select header is found by type: "_select" or key: "_select". This is model binding, not server persistence. maxSelection.count disables unselected row controls once the count is reached; it is not backend authorization or a universal limit on every programmatic assignment or select-all path.

For page-owned bulk modals configured through customModalComponent, the custom-action event supplies selection counts, search/filter context, fetchData, and clearSelection. Its selectedIds are converted with Number; use numeric IDs for this path, since slug values do not survive that conversion as valid numeric identifiers. clearSelection() empties selection and resets the header. A single-row delete preserves other selection until changed rows prune missing IDs; successful selection actions clear the selection after their success handler. Backend endpoints must independently validate scope, permissions, and the intended selected-versus-all operation.

Selection Actions​

Buttons that appear when items are selected:

selectionActions: [
{
slug: "action-slug",
label: "Action Label",
title: "Modal Title",
route: "dashboard.items.bulk-action",
requestMethod: "post",
params: {},
requestBody: { action: "process" },
bodyText: "Are you sure?",
buttonText: "Confirm",
confirmButtonColor: "primary",
prependIcon: "play",
classList: ["btn-primary"],
showWithNoSelection: false,
size: "md",
// Additional modal form
cards: [
{
type: "fields_list",
fieldsList: [
{ type: "text", name: "note", label: "Note" },
],
},
],
onSuccess: () => { /* callback */ },
},
]

Selection actions belong inside options.selectionActions; identify each with a unique slug. The table resolves the chosen action’s named route from params and the current Inertia team slug. Normal entries open ConfirmDelete, use requestMethod (defaulting to DELETE in the modal), and pass requestBody, transformBody, and optional cards. inline changes button placement; showWithNoSelection changes visibility, not the server’s acceptance rules. A customModalComponent delegates through custom-action instead of opening this modal.

The modal chooses bulk submission only when selected IDs are nonempty and a bulk destination exists. The single branch merges current form-card values; it does not apply requestBody or transformBody. The bulk branch merges form-card values, request body, and deleteAllOrSelected; a transformBody function can return the final body. Without a transform, a supplied request body is also copied under data. Design endpoints for this actual payload shape rather than assuming every action posts { ids } plus a flat body.

allowDeleteAll is distinct from selecting the visible page. The table exposes the all-matching choice only when its nonempty visible-row count equals the selection count. It adds advanced condition groups and nonempty search to the action body and attempts a separate count request using the search route. A failed count request can leave a fallback total; it is not proof that the backend will target the same records. Closing either modal resets the operation to "selected". The ordinary delete modal hardcodes allowDeleteAll: false; the former options.deleteAll example did not enable all-matching deletion. allowDeleteAll belongs to a selection-action definition.

The fresh-count request always POSTs { count_only: true }, adding nonempty search and, only in advanced mode, search_mode/condition_groups. It uses the search route’s named route/params with the current team slug; it does not implement all of fetchData’s function/string/plugin route forms. It omits URL/basic/default/inline filter payloads, extraPayload, and an explicit timezone field. The search request can include those filters and extra payload; the all-count request can therefore count a different set. A timezone filter is only represented if included in advanced groups; no separate display timezone is automatically forwarded. Do not use this count as authoritative proof of all-matching mutation scope.

Success callback limitation: the selection action’s onSuccess is passed as the modal’s bulkDeleteSuccess, where it is called without arguments. The modal then emits success and the table calls the same action callback with { fetchData, selectedItems }. A successful bulk selection action can therefore call it twice. Do not destructure arguments unconditionally or put non-idempotent writes in this callback. Prefer server-owned mutation and an idempotent refresh callback that tolerates no argument. This limitation does not certify retry safety for the underlying endpoint.

Bulk Delete​

options: {
bulkDelete: {
route: "dashboard.items.bulk-delete",
params: {},
onSuccess: ({ fetchData, selectedItems }) => {
// After bulk delete
},
},
}

Export behavior​

Exports are configured under options.exports. Three paths have distinct contracts:

  • type: "modal" with cards opens ActionModal. Its named route receives configured params and the current team slug; requestMethod defaults to POST. The transform supplies current selected IDs only for filter: "selected", and an empty ID array for "all" or "approved", leaving the backend to resolve those sets.
  • type: "custom-action" emits custom-action with the export option, ordered selected visible-column keys, total/filtered counts, condition groups, search, custom filters, and an exportFilters object. It delegates display and submission to the page. With an empty visible-column selection this event’s ordered-column list is empty, even though the table’s empty selection displays every header.
  • Ordinary exports resolve a route and always call http.post. body seeds the payload; selected adds selected IDs under selected; applyFilters adds custom filters and appends missing default filters by field. This branch does not automatically copy the full search/advanced/inline-filter payload used by the grid. A success toast confirms the request succeeded, not that a generated file has finished processing or downloaded.

The custom-action exportFilters helper forwards nonempty search plus either advanced condition groups or custom basic filters. It does not merge inline filter values. When matching export output to a filtered grid matters, explicitly verify the page-owned endpoint’s filtering and field authorization. The browser’s visible-column list is not an export permission boundary.

Reordering and updates​

options.draggable enables the draggable table body; options.reorder supplies its persistence contract. Drag sends original order, page-relative old/new indexes, page and page size, and source/target drag metadata. A named reorder route receives the item ID under reorder.key plus params; a function receives (item, data, dataModel). transform(item, data) can shape the PATCH body. The in-progress flag prevents overlapping reorder operations but supplies no server-side transaction or rollback guarantee.

Move-to-position controls require a nonempty static listData, a reorder config whose move is not false, and no search route. They calculate absolute indexes, clamp a one-based position, and send page 1 to avoid a backend pagination offset. Staged reordering changes the parent model array locally and resequences zero-based order without PATCHing.

Legacy inline updates use options.update to PATCH the changed field (or named column), resolving the row ID through update.key. This is separate from attendee InlineEditCell and from form-modal save behavior; do not assume those three paths share a payload or callback API.

Filtering​

options.filter configures FilterDialog, defaultFilters seeds custom basic filters, inlineFilters configures the inline-filter component, and advancedSearch configures the condition builder or modal. Their UI definitions must match backend-supported fields/operators; rendering a condition does not implement its server query.

Use advancedSearch.allowToggleBasicSearch to expose the mode toggle, defaultEnabled for the default advanced state, modal for the modal UI, and showBuilder: false to hide the inline builder. Initial advanced state also considers restored sticky state and the URL search_mode=advanced. A saved-search model and configured fields are passed to the search components; they do not make arbitrary model data public.

Filter lifecycle and saved views​

Basic filter changes reset page to 1. Static arrays return without a request. Internal mode uses fetchData; server-provided mode visits the current URL after merging panel and inline filters and resetting its page parameter. filters-changed and reload-data are shared bus events carrying filter arrays; both replace custom filters after optional filter.eventBusRemap. Function remaps return a replacement filter; object remaps change field/operator/value using truthy fallbacks, so false/zero/empty replacement values do not override the incoming value in that branch. filters-changed also reads a timezone filter for display. Subscriptions are removed on unmount.

Advanced apply enables advanced mode, resets page, and fetches. Turning advanced mode off also fetches. Selecting a saved search deep-copies its search_parameters, records its ID, applies recognized view_parameters, resets page and fetches. View parameters can change valid visible columns, column order, sort and page size; unavailable column keys are ignored. Clearing a saved search clears its condition groups/ID and returns to basic mode.

stickyState.store supplies persistence and optional request orchestration; the table restores and snapshots search/filter/view/page state through that store. This is UI state, not a durable saved search or an access-control policy. Clear-all resets search, advanced state, page, page size, columns and sort before fetching, but does not explicitly clear the separate customFilters or inlineFilterValues arrays. Do not describe it as a guarantee that every filter is removed.

Expandable row details​

options.expandable supplies row-detail cards. The default row renderer opens FormModal; mode: "drawer" emits the row and its scoped store to a single table-level DrawerPanel. Drawer width defaults to "560px", with optional drawerSize. Title, subtitle, and title badges accept values or row functions; badges must resolve to an array.

The drawer renders expandable.cards through FormCard using that row’s store. Opening clears its updated-field tracking. Editing marks fields and displays an unsaved hint; closing only changes panel visibility and does not save or provide a universal discard confirmation. Supply working footerButtons or footerActions for the feature’s persistence contract. A footer action’s onClick(item, context) receives close, fetchData, item, and dataModel; its refresh callback fetches internally or reloads the Inertia page depending on mode. Conditions on footer actions control their visibility, not server permissions.

expandable.projectTags optionally renders the tag picker; model ID can be a function, explicit value, or the row ID fallback. Descendant components can inject dataTableDrawer and call close(). These bindings are distinct from the backend update endpoint: configure and test authorization and save behavior for the row’s resource.

Card View​

The table renders InfoCard only when its style is "card_view" and options.cardLayout exists; otherwise it renders rows. tableDefaultStyle takes precedence over style for initialization. tableStyleKey identifies the Pinia style store and browser localStorage preference. Give unrelated tables distinct keys, and do not reuse a data-model store ID as a style-store key; an existing persisted preference can override a new default. Switching style changes the page size to the first option for that style.

cardLayout supports responsive cols, colsMd, colsLg, colsXl, and colsXxl; the first three default to 12, while the last two are omitted when absent. Configure headerImage as a model-field name or row function, defaultHeaderImage, headerRatio, fieldsList, body classes, and actionClasses as needed. classList can be a row function. Rows in card view still use the table’s data source and pagination.

Card View Action Buttons (additionalActions)​

InfoCard reads actions from cardLayout.additionalActions, independently of table-row options.additionalActions. It routes boolean_icon, form-modal, and download_button through FormField with the card’s model store. Card tooltips are interpolated values, so use strings rather than tooltip functions. Card form-field updates use InfoCard’s own options.update PATCH handler. Other card action types emit additional-action-clicked, but the DataTable’s InfoCard binding does not subscribe to that event; do not assume an arbitrary row onClick action works in card view.

options.expandable opens FormModal from InfoCard; the table-row drawer mode is not wired as a universal card drawer. Edit/delete controls use the corresponding options and hideOnCard flags. Selection checkboxes are rendered by the table’s card slot; unlike table-row checkboxes, that slot does not bind the row-disabled/max-selection check. Enforce any real selection limit server-side and test both presentations.

Data Store Naming Conflicts​

Row detail stores use "update_" + (options.id || "expandable") + "_" + item.id. InfoCard’s generated store uses "update_" + (options.id || "info_card") + "_" + cardItem.id. Set a stable, unique options.id for tables whose row IDs overlap, especially nested tables. An ID namespace avoids unintended shared Pinia models; it does not add backend isolation or reset stores automatically.

Examples​

Static table with a real model store​

This example is a local display with no mutation endpoint. It uses the same DataTable import and Pinia model store as the platform. Mount inside the platform Vue application with Pinia, a global $t translation function, browser APIs, and the platform UI/import setup. An injected globalEventBus enables shared filter/refetch events; the local example itself needs no server request. This is a platform integration example, not a standalone Docusaurus component.

<script setup>
import DataTable from '@/Components/Mod/DataTable.vue'
import { useDataModelStore } from '@/Store/dataModelStore'

const dataStore = useDataModelStore('docs-example-items')
const headers = [
{ key: 'name', title: 'Name', sortable: true },
{ key: 'status', title: 'Status', sortable: false },
]
const rows = [
{ id: 1, name: 'Welcome', status: 'Draft' },
{ id: 2, name: 'Guide', status: 'Published' },
]
const options = {
id: 'docs-example-items',
tableStyleKey: 'docs-example-items-style',
tableDefaultStyle: 'table_view',
defaultItemsPerPage: 10,
}
</script>

<template>
<DataTable
table-title="Items"
:headers="headers"
:options="options"
:list-data="rows"
:data-store="dataStore"
:create-config="{}"
/>
</template>

Internal API table​

Replace the local rows with listData: null and use options.searchRoute = { route: 'your.registered.index.route', params: { /* actual route parameters */ }, requestType: 'get' }. Register the real route in the active client route map and return the paginator shape described above. These route names are placeholders, not additional platform endpoints. In FormCard, put this object under card.options.searchRoute; top-level card.listKey resolves model data rather than an HTTP response envelope.

Troubleshooting and acceptance​

SymptomCheck
Empty table with a successful JSON responseInspect res.data versus direct options.listKey; verify data is an array.
Rows and page counts disagreeRemove mixed listData, paginatedItems, and internal response ownership; include last_page.
JSON endpoint navigates as a pageSet the object search route’s exact lowercase requestType to get or post.
Search does not filter static dataSupply a filtered array or a backend search endpoint; local list computation only sorts/slices.
Selected IDs disappearInspect visible-row pruning after page/filter/refresh changes.
Unknown route resolves to #Check route name, team/project context, and the loaded route group; do not submit a mutation to that destination.
Nested detail forms overwrite each otherGive tables unique options.id values where row IDs overlap.
Card behavior differs from table rowsInspect InfoCard’s own fields/actions/store and the table’s subscribed events.
Export differs from the gridCompare the selected export branch’s payload with the full search/filter request, including inline filters.
Callback runs twice or receives no argumentReview the bulk selection success limitation; use idempotent refresh behavior.

Before enabling a table for a supported module, test empty and populated responses, page-size/page corrections, basic and advanced search, filter precedence, selection after page changes, denied server permissions, and each configured mutation’s actual payload. Check create persistence, export field/filter scope, staged parent saves, and nested-store isolation where applicable. Test both card and row modes if enabled. No browser option replaces backend authorization.

Events​

The DataTable emits the following events:

EventPayloadDescription
update:searchstringSearch text changed
update:selectedarraySelected items changed
custom-actionbranch-specific objectPage-owned selection modal or export workflow

  • IndexPage.vue - Wrapper for standalone DataTable pages
  • FormCard.vue - Renders DataTable as card type
  • FormField.vue - Renders DataTable as form field
  • DataTableRowHandler.vue - Renders individual table rows
  • DataTableColumnHandler.vue - Renders table headers
  • InfoCard.vue - Renders items in card view mode
  • FilterDialog.vue - Filter modal component
  • AdvancedSearch.vue - Advanced search builder
  • ConfirmDelete.vue - Delete confirmation modal
  • FormModal.vue - Create/expandable modal

Source and validation scope​

Reviewed against experience-portal commit 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093: DataTable, DataTableRowHandler, DataTableColumnHandler, InfoCard; create/action/pagination/checkbox helpers; staged list utilities; and the documented CreateDialog/ConfirmDelete bindings. Current selected component/composable suites and the retained pagination contract fixture cover mocked browser behavior. These checks do not certify every child component, live endpoint, export job, or deployment. The configuration reference describes this same contract; module-specific routes and permissions remain the responsibility of each feature’s documentation and acceptance checks.

Reproducing the documentation checks​

From the documentation repository, run node .github/scripts/run-datatable-doc-checks.mjs ../experience-portal with the platform Node dependencies installed. The retained fixtures and runner notes describe the platform mocks and temporary workspace. The review report records source scope, repairs and acceptance gaps. At the reviewed commit, nine suites/69 tests passed, including a mounted copy of the exact static Vue example. No live mutation or export delivery was tested.