Last active
August 29, 2015 14:05
-
-
Save lozcalver/221c251e235bf3b1f274 to your computer and use it in GitHub Desktop.
Editing CSV export fields for a specific group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Group: | |
extensions: | |
- GroupExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GroupExtension extends Extension { | |
public function updateCMSFields($fields) { | |
$gridField = $fields->dataFieldByName('Members'); | |
$exportButton = $gridField->getConfig()->getComponentByType('GridFieldExportButton'); | |
$exportButton->setExportColumns(array( | |
'FirstName' => 'First name', | |
'Surname' => 'Last name', | |
'Email' => 'Email', | |
'LastVisited' => 'Last visited' | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment