I have a GridField diplaying as $has_many realtion with files, I'm tryin to add a column with a link to the file. I thought I'd be able to do it setFieldFormatting but at that level it seems to only have access the page object even though is I remove it, the gridfield does show the $Filename
public function FileForm(){
$config = GridFieldConfig_Base::create();
$fileField = new GridField("Files", "Documents", $this->Files(), $config);
$dataColumns = $fileField->getConfig()->getComponentByType('GridFieldDataColumns');
$dataColumns->setDisplayFields(array(
'Select' => 'Select',
'Title' => 'Title',
'Description' => 'Description',
'Size' => 'Size',
'LastEdited' => 'Changed',
'Filename'=> 'Download'
));
$dataColumns->setFieldFormatting(array(
"Filename" => "<a href=/'$Filename/'>Download</a>"
));
$fields = new FieldList (
$fileField
);
$actions = new FieldList(FormAction::create("doEmail")->setTitle("Send Files"));
return new Form($this, "FileForm", $fields, $actions);
}