TreeView
Since 0.1.0-alpha.21IzzyBlazor.TreeView<TItem> in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.32 assembly
and its doc comments.
Properties (25)
ItemsIEnumerable<TItem>?The items at the top of the tree.
ItemChildrenFunc<TItem, IEnumerable<TItem>?>?An item's children, or null or empty when it has none.
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.
ChildContentRenderFragment<TItem>?An item's content. Without it, ItemText, ItemDescription and ItemIcon draw it.
ItemTextFunc<TItem, string?>? (computed)An item's text, with no template. Defaults to the item's ToString().
ItemDescriptionFunc<TItem, string?>?A muted second line under an item's text, with no template.
ItemIconFunc<TItem, IconData?>?An icon before an item's text, with no template.
ItemLabelFunc<TItem, string>? (computed)Names an item for screen readers: the button that opens its children, and in a tree to choose from the item itself. Defaults to ItemText.
ItemHrefFunc<TItem, string?>?Makes an item a link to this address; null leaves it plain. Not with SelectionMode.
ItemCurrentFunc<TItem, bool>?Marks the item the page is showing. Its branch starts open.
ItemHasChildrenFunc<TItem, bool>?Says an item has children to load with ChildrenProvider when its branch first opens, for items whose ItemChildren is empty.
ChildrenProviderFunc<string, CancellationToken, ValueTask<IEnumerable<TItem>>>?Loads an item's children, given its key, the first time its branch opens: in the component on an interactive page, and on a static page by the script fetching the page with the key. Needs ItemKey and ItemHasChildren.
Searchablebool = falseA search box above the tree that narrows it as you type: matches and their parents stay, their branches open. In the browser, over the items it has; with script.
SearchLabelstring? (computed)The search box's name and placeholder. Defaults to "Search" (Search).
ItemExpandedFunc<TItem, bool>?Starts an item's children open.
ItemDisabledFunc<TItem, bool>?Dims an item and takes away its link, or disables its box. Its children still open.
@bind-ExpandedItemsIReadOnlyCollection<string>?The keys of the items whose children are open, on an interactive page; bind it with @bind-ExpandedItems. Branches that hold the current or a selected item, or that ItemExpanded opens, start open too.
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.
Labelstring?Names the tree for screen readers, when nothing around it does. A tree to choose from needs one.
EmptyTextstring? (computed)Shown when there are no items. Defaults to "No items" (NoItems).
EmptyContentRenderFragment?Content shown when there are no items, in place of EmptyText.
Events (0)
No events.
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 |