TreeMassAction Component
TreeMassAction Component is extension to MassAction component that provides nested sub-menu.
The TreeMassAction JS component is used by the TwoStepMassAction component.
PHP Implementation of TreeMassAction
To enable Massaction Component for your Listing instance it should be declared as a child.
Example:
<Magento_Catalog_module_dir>/view/adminhtml/ui_component/product_listing.xml
Configuration
Component can be configured in two ways:
- Globally: using any module’s
view/*/ui_component/etc/definition.xml
file. All settings declared in this file are applied to all component’s instances
- Locally: using concrete component instance configuration, such as
<Magento_Catalog_module_dir>/view/adminhtml/ui_component/product_listing.xml
TreeMassAction JS Component Structure
Component Elements (classes, files, etc)
The following are the component elements:
- Constructor
app\code\Magento\Ui\view\base\web\js\grid\tree-massactions.js
- Template:
app\code\Magento\Ui\view\base\web\templates\grid\tree-massactions.html
- Template:
app\code\Magento\Ui\view\base\web\templates\grid\submenu.html
Dependencies on Other Components
Dependency on the following component:
- Collapsible:
app\code\Magento\Ui\view\base\web\js\grid\massactions.js
Component Options
The following options are available:
- noItemsMsg - message which will be shown if user tries to apply action without any selected items
- selectProvider - option which defines the component with selections data
- actions - array which contains initially available actions
Methods and Events
The following api methods are available:
- getAction - returns action instance found by the provided identifier
- applyAction - applies specified as identifier action
- hideSubmenus - hide specified actions and nested submenu
app\code\Magento\Catalog\view\adminhtml\ui_component\product_listing.xml
Example of configuration modifications:
- Redefining the link to the template
- Specifying action with confirmation
- Action with a custom callback
Callback is provided by another component.
Instance Replacement: One Instance of a Component
Redefine link to constructor: