Totals and export
Since 0.1.0-alpha.24
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>>?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?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?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?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?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
enumWhat a DataGrid column works out over a group of rows, or over all of them.
| Value | Description |
|---|---|
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 |
DataGroupRequest
recordWhat 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.
| Member | Description |
|---|---|
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: |
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 |
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: |
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
recordWhat a GroupsProvider returns.
| Member | Description |
|---|---|
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 |