GridField Unlink Action for Page


#1

Hi Everyone

silverstripe 4.X,

By Default $many_many field with DataObject displays Edit and Unlink in GridMenu.

I have gridField in page with $many_many to other pages, In Grid Action menu it is showing Edit and ARCHIVE

Is there any way I can enable Unlink for the pages are well in gried action menu.

Thanks

private static $many_many = [
'Categories'=>NewsCategory::class // NewsCategory extends Page
];

// public function getCMSFields()

$category_config = GridFieldConfig_RelationEditor::create();
$category = ToggleCompositeField::create(
    'CategoriesSection',
    $this->fieldLabel('Categories'),
    array(
        new GridField('Categories','Categories',$this->Categories(),$category_config)
    )
);

grid-field