addComponent(new GridFieldExportButton()); // Format column $columns = $this->getComponentByType('GridFieldDataColumns'); $columns->setFieldFormatting(array( 'ParentTitle' => function($value, &$item) { return sprintf( '%s', Convert::raw2xml($item->Link()), Convert::raw2xml($value) ); } )); // Add bulk option $manager = new GridFieldBulkManager(); $manager->addBulkAction( 'markAsSpam', 'Mark as spam', 'CommentsGridFieldBulkAction_MarkAsSpam', array( 'isAjax' => true, 'icon' => 'delete', 'isDestructive' => true ) ); $this->addComponent($manager); } }