Dropdown Editors

Basic usage

Dropdown editors are DropdownList, Multiselect, Multichk, Combobox. They all have a dropdown to select the value(s) from and can be configured by setting the
Opt
parameter:
<OMultiselect @bind-Value="model.Multi1" Opt="dopt" />

<OMultichk @bind-Value="model.Multi2" Opt="dopt" />

<ODropdownList @bind-Value="model.Meal1" Opt="@(new(){ Data = meals })" />

Data binding

Data for the editor is a collection of
KeyContent
and can be set in the
Opt.Data
property or in the
Data
parameter. We can also set the
Opt.DataFunc
to get data on init:
dopt.DataFunc = async () =>
{
    using var cx = await cxf.CreateDbContextAsync();
    return await cx.Meals.Select(o => new KeyContent(o.Id, o.Name)).ToArrayAsync();
}

DropdownOpt

Dropdown editors options
AfterChangeFuncFunction to execute after value has changed
CaptionFuncItem caption custom render func
ClearBtnClear button
CssClassMain container css class
DataComponent data used for selecting values
DataFuncFunction that will execute on component initialization, it will return the data for the component
DisabledIs editor disabled
InLabelLabel rendered next to the editor's selected value (caption)
ItemFuncSelect item render func
MainCaptionFuncMain caption render func
NoSelectCloseNo close on item select
OpenOnHoverOpen dropdown on editor hover
ParentValueFuncFunction that returns the current value of parent components; when the parent value changes the component will reload, (for multiple parents return an array/collection)
SearchFuncFunction to execute after the user stopped typing in the search textbox, gets the search term as parameter
WidthCSS witdh



Comments
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our cookie policy and privacy policy .