Interface IGeneralSelectorDataProvider
- Namespace
- Kentico.Components.Web.Mvc.FormComponents
- Assembly
- Kentico.Content.Web.Mvc.dll
Defines the contract that provides the general selector data.
public interface IGeneralSelectorDataProvider
- Extension Methods
Methods
GetItemsAsync(string, int, CancellationToken)
Returns paged items that will be displayed in the general selector drop down list.
Task<GeneralSelectorSelectListItems> GetItemsAsync(string searchTerm, int pageIndex, CancellationToken cancellationToken)
Parameters
searchTerm
stringThe search term entered in the user interface. Is empty when the user interface initializes.
pageIndex
intThe zero-based page index. The page size can be of any value but must be consistent across all requests.
cancellationToken
CancellationTokenThe cancellation instruction.
Returns
GetSelectedItemsAsync(IEnumerable<GeneralSelectorItem>, CancellationToken)
Transforms the selected values collection into the selector items (value/text) collection.
Task<IEnumerable<GeneralSelectorSelectListItem>> GetSelectedItemsAsync(IEnumerable<GeneralSelectorItem> selectedValues, CancellationToken cancellationToken)
Parameters
selectedValues
IEnumerable<GeneralSelectorItem>The selected values to be displayed in the selector when it loads.
cancellationToken
CancellationTokenThe cancellation instruction.
Returns
- Task<IEnumerable<GeneralSelectorSelectListItem>>
Remarks
This method is called only when the component properties dialog is opened and there are some items already selected in the selector.