Documentation

main.user.selector

Description

The component main.user.selector is a control, ready to be embedded into the various entities selection form.

It can be found in the site structure inside the folder /bitrix/components/bitrix/main.user.selector.

Parameters

ParameterDescription
IDSelector unique ID (value type - string).
API_VERSIONSelector API version (value type - number: default - 2, also supports 3 - with saving of selected entity in "Recents" immediately after it has been selected).
LISTArray of entity codes, listed as already selected. For example: [ 'U1', 'SG2', 'DR3' ].
INPUT_NAMEForm field name that passes the selected value (values). To use multiple selection, use the value FIELD[ ].
USE_SYMBOLIC_IDCan be true or false. Use entity symbolic ID code instead of numerical. Default - false, but if you plan to select entities of different types - use true.
BUTTON_SELECT_CAPTIONLanguage message for control element that opens the selector when no elements are selected (default - "select").
BUTTON_SELECT_CAPTION_MORELanguage message for control element that opens the selector when at least one element is selected (default - "select").
OPEN_DIALOG_WHEN_INITIndicates whether to open the selector popup immediately after control's initialization (and not by clicking on it). Can have the values: true or false. By default: false.
UNDELETABLEArray of entity codes to be displayed in the selector without option to be deleted.
LAZYLOADPostpone data upload to selector (when LIST parameter is empty) before selector opening. Can have the values: Y/N. Default - N, i. e. uploads data immediately.
SELECTOR_OPTIONSSet of options to pass the selection into a popup control.

Example

// Do employees have option to select entity "To all employees"
<?
$APPLICATION->IncludeComponent(
'bitrix:main.user.selector',
' ',
[
   "ID" => "mail_client_config_queue",
   "API_VERSION" => 3,
   "LIST" => array_keys($crmQueueSelected),
   "INPUT_NAME" => "fields[crm_queue][]",
   "USE_SYMBOLIC_ID" => true,
   "BUTTON_SELECT_CAPTION" => Loc::getMessage("MAIL_CLIENT_CONFIG_CRM_QUEUE_ADD"),
   "SELECTOR_OPTIONS" => 
    [
      "departmentSelectDisable" => "Y",
      'context' => 'MAIL_CLIENT_CONFIG_QUEUE',
      'contextCode' => 'U',
      'enableAll' => 'N',
      'userSearchArea' => 'I'
    ]
]
);
?>

© «Bitrix24», 2001-2024