ViewList
Overview
Full-page list view for a Django model. Renders a paginated, sortable, and searchable data grid with support for column hiding, filter groups, bulk actions, targetless actions, workflow transitions, column totals, and switching between paginated and show-all display. Persists sort order, visible columns, and active filters across page visits via the list preference store.
Theme entry: ViewList
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| iconOverride | Object | null | A partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants. | |
| themeOverride | Object | null | A partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants. | |
| app | string | yes | Django app label that owns the model. | |
| model | string | yes | Django model name used to resolve API endpoints and configuration. | |
| listFields | array | [] | Field names to fetch; uses the displayFields keys, then the model config default, when empty. | |
| displayFields | object | {} | Map of field names to display configuration overrides (label, component, etc.). | |
| columnComponents | object | {} | Per-field list column adapter overrides. Each value is a component, a () => component function, or a string key into availableColumns. Takes precedence over modelConfig.config.columnComponents and type defaults; a consumer #field(<col>) slot still wins over both. | |
| columnProps | object | {} | Per-field props forwarded to the resolved list column adapter. | |
object | {} | Rules mapping related object keys to fetch data alongside each list row. | ||
| calculatedObjectsRules | object | {} | Rules mapping calculated object keys to derive computed data alongside each list row. | |
| params | object | {} | Additional query parameters merged into every API request. | |
| scopes | object | {} | Declares which params keys are shown as scopes in the constraints band, keyed by params key: { [key]: { label?, clearable? } }. A declared key is shown while params carries a value for it. label defaults to the filter's metadata label (or the key) with its value; clearable defaults to true. Clearing emits clear-scope; the caller removes those keys from params. Undeclared params keys stay plain request parameters. | |
| tableBreakpoint | string | "lg" | Tailwind breakpoint at which the layout switches from card to table view. | |
| extraFieldObjects | array | [ { name: `selected_`, extra: true, label: "Selected", }, ] | Extra synthetic field objects appended to the field list (e.g. the selected_ checkbox column). | |
| filterables | array | undefined | List of field names to show as filters; overrides the server-provided list when set. | |
| filterableDetails | object | {} | Per-field filter detail overrides merged with server-provided configuration. | |
| pageSizeOptions | array | [...DEFAULT_PAGE_SIZE_OPTIONS] | Rows-per-page options offered by the pagination footer; the final "all" entry loads every page at once. | |
| defaultPageSize | number|string | DEFAULT_PAGE_SIZE | Initial rows-per-page when no preference is stored (a number, or "all"). A stored preference overrides it. | |
| showTotalRecordNum | boolean | undefined | When true, displays the total record count in the pagination bar. Overrides the model config's showTotalRecordNum; when unset, the model config decides, defaulting to true. | |
| allowColumnHiding | boolean | undefined | When true, shows a column-visibility selector so users can hide individual columns. Overrides the model config's allowColumnHiding; when unset, the model config decides, defaulting to false. | |
| primaryActions | array | undefined | Action names promoted to the filled hero CTA in the page title; defaults to the create action. |
Slots
| Name | Scoped | Description |
|---|---|---|
targetless-action-buttons | yes | |
targetless-action-button | yes | Replaces an individual targetless action button. |
search | yes | |
columns-select | yes | |
columns-select-value-label | ||
additional-errors | ||
before-list | ||
`field(${name})` | yes | |
row-after-objects | yes | |
bulk-action-button | yes | Replaces an individual bulk action button. |
workflow-action-button | yes | Replaces an individual workflow/transition action button. |
Events
| Name | Description |
|---|---|
selected | Emitted once on mount with a live ref to the selected primary keys (actions.selectedObjects). |
sorted | Emitted once on mount with a live ref to the active sort order (sort.sorting.state.sorted). |
objects | Emitted once on mount with a live ref to the raw fetched objects (list.instanceList.state.objects). |
order | Emitted once on mount with a live ref to the current object ordering (list.instanceList.state.order). |
loading | Emitted once on mount with a live ref to the combined loading state (list.loading). |
related-objects | Emitted once on mount with a live ref to the fetched related objects. |
calculated-objects | Emitted once on mount with a live ref to the fetched calculated objects. |
filtered | Emitted once on mount with a live ref to the active-filter list (filter.state.addedFilters). |
query-change | Emitted once on mount with a live ref to the current route query. |
hide-filter-form | Forwarded from FilterGroup when a filter form popover should close. |
clear-scope | Emitted with { name, keys } when the reader clears a params key declared through the scopes prop. The prop is left unchanged: the caller removes keys from params, which removes the scope from the request and the constraints band. |
Source
client/lib/views/ViewList.vue