mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Respect displayFields in GridFieldPrintButton
Provides more coherent and expected default behaviour
This commit is contained in:
parent
703c10aa0e
commit
80feb8c0b4
@ -91,9 +91,14 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr
|
||||
* Export core.
|
||||
*/
|
||||
public function generatePrintData($gridField) {
|
||||
$printColumns = ($this->printColumns)
|
||||
? $this->printColumns
|
||||
: singleton($gridField->getModelClass())->summaryFields();
|
||||
if($this->printColumns) {
|
||||
$printColumns = $this->printColumns;
|
||||
} else if($dataCols = $gridField->getConfig()->getComponentByType('GridFieldDataColumns')) {
|
||||
$printColumns = $dataCols->getDisplayFields($gridField);
|
||||
} else {
|
||||
$printColumns = singleton($gridField->getModelClass())->summaryFields();
|
||||
}
|
||||
|
||||
$header = null;
|
||||
if($this->printHasHeader){
|
||||
$header = new ArrayList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user