Update BULK_MANAGER.md

Add notes on adding and removing actions as it wasn't obvious for me on first look.
This commit is contained in:
will 2024-01-09 10:39:08 +00:00 committed by GitHub
parent 88a08f5387
commit e572ae3b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,15 @@ $config->getComponentByType('Colymba\\BulkManager\\BulkManager')->setConfig($ref
The available configuration options are:
* 'editableFields' : array of string referencing specific CMS fields available for editing
## Removing and Adding actions
To remove an action call removeBulkAction using the fully namespaced classname.
```php
$gridField->getConfig()->getComponentByType('\Colymba\BulkManager\BulkManager')->removeBulkAction(\Colymba\BulkManager\BulkAction\UnlinkHandler::class);
```
To add an action:
```php
$gridField->getConfig()->getComponentByType('\Colymba\BulkManager\BulkManager')->addBulkAction(\Colymba\BulkManager\BulkAction\UnlinkHandler::class);
```
## Custom actions
You can remove or add individual action or replace them all via `addBulkAction()` and `removeBulkAction()`