mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT GridFieldExportButton now supports dot syntax for column sources through DataObject::relField()
This commit is contained in:
parent
92b6adfcb5
commit
4bcd44aee6
@ -113,7 +113,7 @@ class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionP
|
||||
foreach($items as $item) {
|
||||
$columnData = array();
|
||||
foreach($csvColumns as $columnSource => $columnHeader) {
|
||||
$value = $item->$columnSource;
|
||||
$value = $item->relField($columnSource);
|
||||
$value = str_replace(array("\r", "\n"), "\n", $value);
|
||||
$columnData[] = '"' . str_replace('"', '\"', $value) . '"';
|
||||
}
|
||||
@ -172,4 +172,4 @@ class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionP
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user