Skip to content
IzzyBlazor 0.1.0-alpha.20

Enter all results ↑ ↓ move Esc close

Selection

Checkboxes that post with a form, totals, and actions on the selected rows.

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

Properties (9)

ItemKeyFunc<TItem, string>? (computed)

A unique, stable key for each item, such as its id. Selection posts and binds these keys. Defaults to the item's string form.

SelectionModeSelectionMode = SelectionMode.NoneAdded in 0.1.0-alpha.20

Whether items can be selected: one (a radio button on each) or several (a checkbox on each). Inside a form, the selected items post their ItemKey under SelectionName; bind Selection to follow them.

SelectionNamestring? (computed)

The form field name the selection posts under, read back as a Selection with [SupplyParameterFromForm(Name = ...)]. Defaults to "{QueryPrefix}selected": give two selectable views in one form a QueryPrefix (or a name) each.

@bind-SelectionSelection?Added in 0.1.0-alpha.20 @bind: Interactive only

The selected items: keys on any page, or every item matching the filter except some. On a static page pass back the posted one. Selecting all that match is cleared when the filter or search changes.

ItemSelectableFunc<TItem, bool>?Added in 0.1.0-alpha.20

Whether an item can be selected; others show a disabled, unchecked box, and selecting the page or a range leaves them out. "Select all" (every matching item) can't know this rule: leave them out of the query you apply the Selection to.

SelectAllModeSelectAllMode = SelectAllMode.PageAdded in 0.1.0-alpha.20

What the select-all checkbox selects: the items on this page, or every item the filters match, on any page. Those aren't loaded, so act on them with Selection.Apply. With virtual rows, SelectAllMode.Page reaches only the rows drawn.

SelectionActionsRenderFragment<Selection>?Added in 0.1.0-alpha.20

Actions on the selection, in a bar above the items, disabled until something is selected (on a DataGrid with a toolbar, the bar takes the toolbar's place while something is). Submit buttons in the surrounding form post the selection. A link can't be disabled, so it stays live. Without these there's no bar.

SelectAllLabelstring? = "Select all rows"

The select-all checkbox's name for screen readers. Defaults to "Select all rows".

SelectRowLabelstring? = "Select"

The start of each item checkbox's name for screen readers, before the item's label. Defaults to "Select".

Parts (2)

Components written inside Table, and the columns' members, which PropertyColumn and TemplateColumn 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).

FooterTextstring?

Text for this column in the table's footer row, such as a total.

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).

FooterTextstring?

Text for this column in the table's footer row, such as a total.

Types (3)

SelectAllMode

enum

What a select-all checkbox selects.

SelectAllMode values
ValueDescription
Page

The items on this page.

All

Every item the filters match, on any page, as a Selection that says so rather than listing them.

Selection

class

The items selected in a Table or ListView: some keys, or every item matching a filter and search except some keys (SelectAllMode.All). Bind it with @bind-Selection, or on a static page with [SupplyParameterFromForm(FormName = "...", Name = "...")] under the view's SelectionName. For a bulk action, Apply gives the selected items from a query.

Selection members
MemberDescription
None

Nothing selected.

Of(IEnumerable<string> keys)

These keys selected.

AllOf<TItem>(DataRequest<TItem> request)
Keys string[]?

The selected keys; with All, the keys left out.

All bool = false

Every item matching Filter and Search is selected, except Keys.

Filter string?

With All, the filter it was made under, in the ?filter= form; null for none.

Search string?

With All, the search it was made under; null for none.

KeyList string?

The keys as one JSON list, as the script posts a selection kept across pages: one field rather than one per key, which stays under the server's limit of 1,024 form values. Added to Keys. For the form post, not for code.

IsEmpty bool = true

Nothing is selected.

Apply<TItem>(IQueryable<TItem> source, Expression<Func<TItem, string>> key)
Apply<TItem>(IQueryable<TItem> source, Expression<Func<TItem, string>> key, IReadOnlyList<DataField<TItem>> fields)
Contains(string key)

Whether the item with this key is selected (for All, among the matching items).

Count(int? total)

How many are selected, given how many match; null when All and the total isn't known.

MatchesScope(Filter? filter, string? search)

Whether All was made under this filter and search; when not, the selection no longer means the same items.

With(string key, bool selected)

A copy with this key selected or cleared.

SelectionMode

enum

How many items can be selected.

SelectionMode values
ValueDescription
None

No selection. The default.

Single

One item, with a radio button on each.

Multiple

Any number, with a checkbox on each; with script, a box to select them all (see SelectAllMode).

Connection lost

Rejoining the server…