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) {
|
foreach($items as $item) {
|
||||||
$columnData = array();
|
$columnData = array();
|
||||||
foreach($csvColumns as $columnSource => $columnHeader) {
|
foreach($csvColumns as $columnSource => $columnHeader) {
|
||||||
$value = $item->$columnSource;
|
$value = $item->relField($columnSource);
|
||||||
$value = str_replace(array("\r", "\n"), "\n", $value);
|
$value = str_replace(array("\r", "\n"), "\n", $value);
|
||||||
$columnData[] = '"' . str_replace('"', '\"', $value) . '"';
|
$columnData[] = '"' . str_replace('"', '\"', $value) . '"';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user