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.
|
* Export core.
|
||||||
*/
|
*/
|
||||||
public function generatePrintData($gridField) {
|
public function generatePrintData($gridField) {
|
||||||
$printColumns = ($this->printColumns)
|
if($this->printColumns) {
|
||||||
? $this->printColumns
|
$printColumns = $this->printColumns;
|
||||||
: singleton($gridField->getModelClass())->summaryFields();
|
} else if($dataCols = $gridField->getConfig()->getComponentByType('GridFieldDataColumns')) {
|
||||||
|
$printColumns = $dataCols->getDisplayFields($gridField);
|
||||||
|
} else {
|
||||||
|
$printColumns = singleton($gridField->getModelClass())->summaryFields();
|
||||||
|
}
|
||||||
|
|
||||||
$header = null;
|
$header = null;
|
||||||
if($this->printHasHeader){
|
if($this->printHasHeader){
|
||||||
$header = new ArrayList();
|
$header = new ArrayList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user