Adds a duplicate button to GridField in the CMS that enables duplicating of dataobjects
composer require jinjie/ss4-duplicate-dataobject
This module uses the built in DataObject duplication.
See
// Add component on existing GridField
$fields->fieldByName('Root.Main.MyGridField')
->getConfig()
->addComponent(new GridFieldDuplicateAction());
// Add component on new GridField
$fields->push(
GridField::create(
'MyGridField',
'MyGridField'
)->addComponent(new GridFieldDuplicateAction())
);
Developed by Jin Jie @ Swift DevLabs