Table of Contents

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 string

The search term entered in the user interface. Is empty when the user interface initializes.

pageIndex int

The zero-based page index. The page size can be of any value but must be consistent across all requests.

cancellationToken CancellationToken

The cancellation instruction.

Returns

Task<GeneralSelectorSelectListItems>

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 CancellationToken

The 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.