Overview

The grid that lists a resource's records

Every resource has an index page: a grid of its records, at /stellaradmin/{slug}. You configure it with resource.Index:

resource.Index(index =>
{
    index.Columns(columns =>
    {
        columns.Add(booking => booking.Reference);
        columns.Add(booking => booking.Customer);
        columns.Add(booking => booking.DepartureDate, column => column.Sortable());
    });
    index.EnableSearch(term => booking => booking.Reference.Contains(term));
    index.EnableScopes(scopes =>
    {
        scopes.Add("all", "All");
        scopes.Add("pending", "Pending", booking => booking.Status == BookingStatus.Pending);
        scopes.DefaultScope = "all";
    });
    index.DefaultSortBy(booking => booking.DepartureDate);
    index.EnablePaging();
});
FeaturePage
What the grid showsColumns
A search boxSearch
Tabs such as All, Pending and ConfirmedScopes
Clickable headers and pagesSorting and paging
Rows that expand to show moreRow details
Editing and adding records in the gridInline editing

Search, scopes, sorting and paging update the grid in place and keep their state in the URL, so a filtered list can be bookmarked or shared. Changing the search or the scope takes you back to page 1.

Title and labels

PropertyDefault
index.TitleThe plural label, such as Bookings
index.CreateLabelCreate
index.EditLabelEdit {singular}, such as Edit Booking
index.ViewLabelView {singular}
index.DeleteLabelDelete {singular}
resource.Index(index =>
{
    index.Title = "All bookings";
    index.CreateLabel = "New booking";
});

The row actions are view, edit and delete, depending on which pages you've allowed. Custom row actions and bulk actions aren't supported yet.

On this page