Skip to content

Commit

Permalink
Merge pull request #14 from brettt89/patch-2
Browse files Browse the repository at this point in the history
Userforms Bulk Export Button - Fix default submission fields
  • Loading branch information
Hamish Friedlander authored Jun 13, 2016
2 parents 52a670b + 92443bc commit 96c3df7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/extensions/UserFormUseQueuedExportExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ function updateCMSFields(FieldList $fields) {
$gridField = $fields->fieldByName('Root.Submissions.Submissions');

$config = $gridField->getConfig();
$oldExportButton = $config->getComponentByType('GridFieldExportButton');
$config->addComponent($newExportButton = new GridFieldQueuedExportButton('buttons-after-left'));

// Set Header and Export columns on new Export Button
$newExportButton->setCsvHasHeader($oldExportButton->getCsvHasHeader());
$newExportButton->setExportColumns($oldExportButton->getExportColumns());

$config->removeComponentsByType('GridFieldExportButton');
$config->addComponent(new GridFieldQueuedExportButton('buttons-after-left'));
}
}

0 comments on commit 96c3df7

Please sign in to comment.