Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Selection

Since 0.1.0-alpha.21
Checkboxes or a single choice. The keys post with a form or bind to C#.

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

Properties (6)

ItemKeyFunc<TItem, string>?Added in 0.1.0-alpha.21

A key that tells items apart, such as an id. Needed for selection, and for branches a person opened to stay open across pages; without it, each item's place is kept by the item itself.

SelectionModeSelectionMode = SelectionMode.NoneAdded in 0.1.0-alpha.21

SelectionMode.Multiple gives each item a checkbox; SelectionMode.Single selects one item. Needs ItemKey.

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

The selected items' keys. Bind it with @bind-Selection.

SelectionNamestring? = selectedAdded in 0.1.0-alpha.21

The form name the selected keys post under, as {name}.Keys; read them with [SupplyParameterFromForm(Name = "...")] Selection. Defaults to selected.

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

Whether an item can be selected; one that can't keeps its place, with its box disabled, and with script a click on it opens or closes its branch.

Cascadebool = trueAdded in 0.1.0-alpha.21

With checkboxes, checking a parent checks its branch, and a parent shows how much of its branch is checked. On by default; false makes each box its own.

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…