1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс CAdminUiListActionPanel

Открытые члены

 __construct ($tableId, array $actions, array $actionsParams)
 getActionPanel ()
 setActionSections (array $actionSections, $listKeyForDelete=[])
 setTypeToSectionMap (array $mapTypesAndSections)
 setHandlerToType (array $mapTypesAndHandlers)

Подробное описание

Class CAdminUiListActionPanel A class for working with group actions. Allows you to create your own group actions. Example of use:

The array for $lAdmin->AddGroupActionTable($arGroupActions, $arParamsGroupActions); $arGroupActions['test_my_type'] = array('type' => 'my_type', 'name' => 'Check custom actions');

$actionPanelConstructor = new CAdminUiListActionPanel( $this->table_id, $this->arActions, $this->arActionsParams);

Set your own section $actionPanelConstructor->setActionSections(["my_section" => []], ["default"]); Set your own action type $actionPanelConstructor->setTypeToSectionMap(["my_type" => "my_section"]); Set handler for your type $actionPanelConstructor->setHandlerToType(["my_type" => function ($actionKey, $action) { $onChange = [ [ "ACTION" => Panel\Actions::CREATE, "DATA" => [ [ 'TYPE' => Panel\Types::CUSTOM, 'ID' => 'my_custom_html', 'VALUE' => 'Hello!', ] ] ] ]; return [ "ID" => $actionKey, "TYPE" => Bitrix\Main\Grid\Panel\Types::BUTTON, "TEXT" => $action["name"], "ONCHANGE" => $onChange ]; }]);

return $actionPanelConstructor->getActionPanel();

См. определение в файле admin_ui_list.php строка 1253

Конструктор(ы)

◆ __construct()

__construct ( $tableId,
array $actions,
array $actionsParams )

См. определение в файле admin_ui_list.php строка 1276

Методы

◆ getActionPanel()

getActionPanel ( )

The method returns an array of data of the desired format for the grid.

Возвращает
array

См. определение в файле admin_ui_list.php строка 1308

◆ setActionSections()

setActionSections ( array $actionSections,
$listKeyForDelete = [] )

The method writes a value into an array of sections. This array is the structure of the blocks into which you place your actions.

Аргументы
array$actionSectionsMap sections.
array$listKeyForDeleteList keys for delete default sections. Example: [ "default" => [ "TYPE" => Types::BUTTON, "ID" => "button_id", "CLASS" => "apply", "TEXT" => "My button", "ONCHANGE" => [ [ "ACTION" => Panel\Actions::CALLBACK, "DATA" => [ [ "JS" => "alert('Click!');" ] ] ] ] ] ];

См. определение в файле admin_ui_list.php строка 1344

◆ setHandlerToType()

setHandlerToType ( array $mapTypesAndHandlers)

The method writes a handler for a particular type of action. This allows you to create your own action.

Аргументы
array$mapTypesAndHandlersMap of types and handlers. Example: [ "button" => function ($actionKey, $action) { $onChange = [ [ "ACTION" => Panel\Actions::CALLBACK, "DATA" => [ [ "JS" => $action["action"] ? $action["action"] : "BX.adminUiList.SendSelected('{$this->tableId}')" ] ] ] ] return [ "ID" => $actionKey, "TYPE" => Bitrix\Main\Grid\Panel\Types::BUTTON, "TEXT" => $action["name"], "ONCHANGE" => $onChange ]; }]

См. определение в файле admin_ui_list.php строка 1393

◆ setTypeToSectionMap()

setTypeToSectionMap ( array $mapTypesAndSections)

The method writes values to a map of types and partitions. This makes it possible to place any type of action in a specific action section.

Аргументы
array$mapTypesAndSectionsMap of types and sections. Example ["html" => "default"].

См. определение в файле admin_ui_list.php строка 1362


Объявления и описания членов класса находятся в файле: