List Views
Configure table views — columns, sorting, search, and display.
List views control how collections appear in the admin table. Configure them with .list() on your collection.
Basic Table
.list(({ v }) => v.collectionTable({}))With no additional config, the table shows all fields as columns with default rendering.
Custom Columns
Specify which fields to show and their order:
.list(({ v, f }) =>
v.collectionTable({
columns: [f.name, f.email, f.isActive, f.createdAt],
searchableFields: [f.name, f.email],
}),
)| Option | Type | Description |
|---|---|---|
columns | Field[] | Fields to show as columns |
searchableFields | Field[] | Fields included in text search |
defaultSort | { field, direction } | Default sort order |
orderable | boolean | object | Enable drag reorder mode |
Sorting
Tables support sorting by any column. Set a default:
.list(({ v, f }) =>
v.collectionTable({
defaultSort: { field: f.createdAt, direction: "desc" },
}),
)Search
Mark fields as searchable for the global search bar:
.list(({ v, f }) =>
v.collectionTable({
searchableFields: [f.title, f.slug, f.tags],
}),
)Orderable Lists
Orderable lists are explicit. QUESTPIE does not infer reorder behavior from a business field like price, createdAt, or title.
Use this recipe when editors should manually control the display order of records:
- Add a numeric field named
orderto the collection. - Create and run a migration for that field.
- Set initial values in seeds or a one-off backfill.
- Enable
orderablein the list view. - Use
defaultSort: { field: f.order, direction: "asc" }so the table opens in reorder-compatible order.
export const services = collection("services")
.fields(({ f }) => ({
name: f.text(255).required(),
price: f.number().required(),
order: f.number().default(0).required(),
}))
.list(({ v, f }) =>
v.collectionTable({
columns: [f.name, f.price, f.order],
defaultSort: { field: f.order, direction: "asc" },
orderable: true,
}),
);orderable uses the conventional order field. This is deliberate: reorder mode updates order values, so it must never point at domain data such as price.
The admin only enables reorder mode when the current list is safe to reorder:
- The collection list has
orderableenabled. - The collection has an
orderfield. - The current sort is
order ascunless you configure another direction. - Search, grouping, filters, and multi-page result sets are inactive.
When an editor drags rows, QUESTPIE writes the new order through the normal collection update pipeline using batch updates. Access rules, field validation, hooks, realtime invalidation, and versioning still apply.
You can customize direction and spacing between generated values:
.list(({ v, f }) =>
v.collectionTable({
defaultSort: { field: f.order, direction: "asc" },
orderable: { direction: "asc", step: 10 },
}),
)Do not use orderable for computed, localized, relation, or business fields. Add a dedicated order field instead.
Related Pages
- Form Views — Edit forms
- Filters — Advanced filtering
- Collections — Collection builder