1C-Bitrix 25.700.0
|
Открытые члены | |
__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
См. определение в файле admin_ui_list.php строка 1276
getActionPanel | ( | ) |
The method returns an array of data of the desired format for the grid.
См. определение в файле admin_ui_list.php строка 1308
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 | $actionSections | Map sections. |
array | $listKeyForDelete | List 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 | ( | array | $mapTypesAndHandlers | ) |
The method writes a handler for a particular type of action. This allows you to create your own action.
array | $mapTypesAndHandlers | Map 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 | ( | 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 | $mapTypesAndSections | Map of types and sections. Example ["html" => "default"]. |
См. определение в файле admin_ui_list.php строка 1362