QUESTPIE

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],
  }),
)
OptionTypeDescription
columnsField[]Fields to show as columns
searchableFieldsField[]Fields included in text search
defaultSort{ field, direction }Default sort order
orderableboolean | objectEnable drag reorder mode

Sorting

Tables support sorting by any column. Set a default:

.list(({ v, f }) =>
  v.collectionTable({
    defaultSort: { field: f.createdAt, direction: "desc" },
  }),
)

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:

  1. Add a numeric field named order to the collection.
  2. Create and run a migration for that field.
  3. Set initial values in seeds or a one-off backfill.
  4. Enable orderable in the list view.
  5. 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 orderable enabled.
  • The collection has an order field.
  • The current sort is order asc unless 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.

On this page