Selection
Since 0.1.0-alpha.21
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>?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.NoneSelectionMode.Multiple gives each item a checkbox; SelectionMode.Single selects one item. Needs ItemKey.
@bind-SelectionSelection?The selected items' keys. Bind it with @bind-Selection.
SelectionNamestring? = selectedThe form name the selected keys post under, as {name}.Keys; read them with [SupplyParameterFromForm(Name = "...")] Selection. Defaults to selected.
ItemSelectableFunc<TItem, bool>?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 = trueWith 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
classThe 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.
| Member | Description |
|---|---|
None | Nothing selected. |
Of(IEnumerable<string> keys) | These keys selected. |
AllOf<TItem>(DataRequest<TItem> request) | |
Keys string[]? | The selected keys; with |
All bool = false | |
Filter string? | With |
Search string? | With |
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 |
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 |
Count(int? total) | How many are selected, given how many match; null when |
MatchesScope(Filter? filter, string? search) | Whether |
With(string key, bool selected) | A copy with this key selected or cleared. |
SelectionMode
enumHow many items can be selected.
| Value | Description |
|---|---|
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 |