A2v10 Platform documentation
UK


Selector Control

Represents the universal selector.

Inherits: ValuedControl : Control : UIElement : UIElementBase

Properties

Name Type Description
Delegate String Name of the delegate that will be called when the text is entered into the selector field.
SetDelegate String Name of the delegate, that will be called when selecting an item in the drop-down panel. If this delegate is specified, no assignments of the associated item will be performed.
TextValue Object Always a binding (Bind). Text binding. If it is specified, then when an item is selected in the list, the text will be passed to it, not the item itself.
Align TextAlign Text alignment.
Placeholder String Prompt. Displayed in an empty input field. Disappears when the input field receives focus.
Style SelectorStyle Selector display style. Possible values:
  • Default - (by default) regular selector.
  • ComboBox - selector in the form of a combined drop-down list. Filtering is not supported in this case.
  • Hyperlink - selector in the form of a hyperlink. Filtering is not supported in this case.
Size ControlSize Item size. Possible values:
  • Default - (by default) regular selector size.
  • Large - increased selector size.
(Other values of the ControlSize enumeration are not supported).
ItemsSource Array Always a binding - Bind. Data source to display in the list.
DisplayProperty String Name of the property of the base item that will be displayed in the selector.
PanelPlacement DropDownPlacement The direction of the selector selection panel "dropdown". Possible values:
  • BottomLeft - (by default) downwards with the left edge binding.
  • BottomRight - downwards with the right edge binding.
  • TopLeft - upwards with the left edge binding.
  • TopRight - upwards with the right edge binding.
ListSize Size Dimensions of the drop-down selector panel.
ItemsPanel UIElementBase Description of the drop-down panel. In the current version, only the DataGrid item is supported as a drop-down panel. If the item is not specified, a simple list of items is used.
NewPane UIElementBase Description of the panel for creating a new item.
CreateNewCommand BindCmd The command that will be executed when a new item is created.
ShowCaret Boolean? Show content opening icon. If the style of the selector is ComboBox, then the value is automatically set to True.
ShowClear Boolean Show clear content button. Clicking this button calls the $empty method for the associated item.
Base item properties

Description

The selector can work in two modes. Select from the list and search in the list/on the server.

The first simply emulates a combo box (ComboBox) with additional styling options for the selection window. In this case, the collection for selection (ItemsSource property) and the name of the property of the associated item (DisplayProperty property) which should be displayed in the selector are specified.

In the second case, it is necessary to specify a delegate (Delegate property) which will be called occasionally when entering text in the selector field.

It is possible to create a new item if nothing is found in the list. To do this, specify the NewPane item creation panel and the CreateNewCommand command..

Search delegate format (Delegate)

fetch(this:IRoot, elem:IElement, text:string, all?: boolean): [] | Promise

Parameters:

  • this - data model root.
  • elem - the item associated with the selector.
  • text - the text typed into the input field.
  • all - a sign that it is necessary to display all values from the list. Will be true if the ShowCaret property is set and the user opens the selection window with a button rather than typing in a field.

Returned value:

The delegate should return an array of elements, or a Promise if the elements are fetched from the server.

What the delegate returned will be displayed in the selection panel.

Set delegate format (SetDelegate)

fetch(this:IRoot, elem:IElement): void

Parameters:

  • this - data model root.
  • elem - the set (selected in the list) item.