Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Totals and export

Since 0.1.0-alpha.24
Rows show the totals of their branches, the footer the totals of every match, and exports keep the tree's levels.

The members for totals and export, and the types they use. Every member of IzzyBlazor.TreeList<TItem> is on the TreeList API.

Properties (3)

GroupsProviderFunc<DataGroupRequest<TItem>, ValueTask<DataGroupResult>>?Added in 0.1.0-alpha.24

With an ItemsProvider, works out the footer's aggregates (a column's Aggregate) over every row the filters match, as the rows it holds are only a page's: answer it with request.ToResultAsync over the same query.

ExportCsvHrefstring?Added in 0.1.0-alpha.24

A link in the toolbar, in a menu with ExportExcelHref and any DataGridExportFormat, to an endpoint that writes the rows as CSV with DataExport, for a grid that offers CSV besides Excel. It adds the current filter, sort, search and columns to the address. The endpoint's fields need the grid's keys, and its FilterCase as their Case, for the file to match the screen.

ExportExcelHrefstring?Added in 0.1.0-alpha.24

A link in the toolbar, in a menu with ExportCsvHref and any DataGridExportFormat, to an endpoint that writes the rows as an Excel workbook with DataExport. It adds the current filter, sort, search and columns to the address. The endpoint's fields need the grid's keys, and its FilterCase as their Case, for the file to match the screen.

Parts (1)

Components written inside TreeList, and the columns' members, which PropertyColumn, TemplateColumn and DynamicColumn share.

PropertyColumn<TItem, TValue>

A column that shows one property of each item, formatted, and can sort by it. The title and sort key come from the property ([Display(Name)] is used when present).

AggregateDataAggregate?Added in 0.1.0-alpha.20

What this column shows in the grid's footer, worked out over every row the filters match, not just the page. Grouping isn't needed. Not for a Table.

RollUpDataAggregate?Added in 0.1.0-alpha.24

In a TreeList, what a row with rows under it shows in this column in place of its own value: the sum, average, lowest, highest or count of the rows at the ends of its branch, such as a folder's size or a project's hours. While filtering, of the rows kept. Not with an ItemsProvider: give the rows their totals there.

Types (3)

DataAggregate

enum

What a DataGrid column works out over a group of rows, or over all of them.

DataAggregate values
ValueDescription
Sum

The values added up. For numbers.

Avg

The mean of the values. For numbers.

Min

The lowest value. For numbers, dates, times and text.

Max

The highest value. For numbers, dates, times and text.

Count

How many rows.

Custom

The field's own AggregateBy.

DataGroupRequest

record

What a DataGrid asks its GroupsProvider for: one level of groups with their counts and aggregates, or, with no Keys, the one group of everything that matches, which is the grand total. Rows aren't part of it: an open group's rows come from the ItemsProvider, with the group's values in its filter. Answer it with ToResultAsync.

DataGroupRequest members
MemberDescription
Keys IReadOnlyList<SortField>

The fields to group by, outermost first, and the order of each; empty for the grand total.

Aggregates IReadOnlyList<DataAggregateField>

What to work out for each group, besides its count.

Filter Filter?

The filter, or null for none.

Search string?

Free text to look for, in the searchable fields; null for none.

Skip int = 0

Groups to skip.

Take int?

Groups to take; null for every group.

NeedsTotal bool = false

Whether the component needs how many groups there are in all.

CancellationToken CancellationToken = CancellationToken.None

Canceled when the component no longer needs this answer.

ToQueryString()

The request as a query string, for a GET API: group=status,-customer&aggregate=total:sum&skip=20&take=10&filter=...&search=..., with total=true when it needs the number of groups. Read it back with Parse.

ToResult(IQueryable<TItem> source)

The groups, from an in-memory list or a synchronous query, with the component's fields.

ToResult(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields)

The groups, through these fields only, for a request that came over the wire: a key that isn't Groupable or an aggregate that isn't Aggregatable is left out, so a request can't reach other properties.

ToResultAsync(IQueryable<TItem> source, Func<IQueryable<object?[]>, CancellationToken, Task<int>> count, Func<IQueryable<object?[]>, CancellationToken, Task<List<object?[]>>> list)

The groups through your async methods, so Core needs no EF Core: count: (q, ct) => q.CountAsync(ct), list: (q, ct) => q.ToListAsync(ct).

ToResultAsync(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields, Func<IQueryable<object?[]>, CancellationToken, Task<int>> count, Func<IQueryable<object?[]>, CancellationToken, Task<List<object?[]>>> list)

The groups through your async methods, through these fields only.

DataGroupResult

record

What a GroupsProvider returns.

DataGroupResult members
MemberDescription
Groups IReadOnlyList<DataGroup>

The groups, in order. For a grand total, one.

Total int?

How many groups there are in all, when the request's NeedsTotal asks.

Connection lost

Rejoining the server…