description |
---|
Configuring the list view of a collection in Umbraco UI Builder, the backoffice UI builder for Umbraco. |
A list view is a list-based view of a collection entity providing features: pagination for large collections, custom data views, searching, and bulk actions.
The list view configuration is a sub-configuration of a Collection
config builder instance and is accessed via its ListView
method.
Accesses the list view config of the given collection.
// Example
collectionConfig.ListView(listViewConfig => {
...
});
AddField(Lambda propertyExpression, Lambda fieldConfig = null) : ListViewFieldConfigBuilder<TEntityType, TValueType>
Adds the given property to the list view.
// Example
listViewConfig.AddField(p => p.FirstName, fieldConfig => {
...
});
Sets the heading for the list view field.
// Example
fieldConfig.SetHeading("First Name");
Sets the format expression for the list view field.
// Example
fieldConfig.SetFormat((v, p) => $"{v} years old");
With field views, you can customize the markup the list view's field so you can show richer visualizations of the field's content. For more information you can check the Field Views Documentation.
Sets the view component for the list view field.
// Example
fieldConfig.SetView("ImageFieldView");
Sets the view component for the list view field.
// Example
fieldConfig.SetView<ImageFieldView>();
SetVisibility(Predicate<ListViewFieldVisibilityContext> visibilityExpression) : ListViewFieldConfigBuilder<TEntityType, TValueType>
Sets the runtime visibility of the list view field.
// Example
fieldConfig.SetVisibility(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
Sets the number of items to display per page for the given list view.
// Example
listViewConfig.SetPageSize(20);