Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Selection

Since 0.1.0-alpha.24
Checkboxes select rows, and checking a row checks the rows under it.

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

Properties (7)

Cascadebool = trueAdded in 0.1.0-alpha.24

With SelectionMode.Multiple, checking a row checks the rows under it, and a row with some of them checked shows a mixed box. A checked row stands for its whole branch: rows under it come in checked as they're drawn, and ApplyTree finds them all. On by default; false makes each box its own.

SelectOnClickbool = falseAdded in 0.1.0-alpha.24

A click on a row selects it, with IzzyBlazor's script; clicks on its links, buttons and fields stay theirs. With one row (SelectionMode.Single) the radio buttons are hidden, and Space on the selected row clears it. With several, a click selects only that row, Ctrl+click adds or removes one and Shift+click a range, and the checkboxes stay.

SelectionModeSelectionMode = SelectionMode.NoneAdded in 0.1.0-alpha.24

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)Added in 0.1.0-alpha.24

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.24 @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.24

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.

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

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.

Types (2)

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)
ApplyTree<TItem, TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent)
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…