src/Forms/GridField/GridFieldExportButton.php
protected function getExportColumnsForGridField(GridField $gridField)
    {
        if ($this->exportColumns) {
            return $this->exportColumns;
        }

        /** @var GridFieldDataColumns $dataCols */
        $dataCols = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
        if ($dataCols) {
            return $dataCols->getDisplayFields($gridField);
        }

        return DataObject::singleton($gridField->getModelClass())->summaryFields();
    }
protected function getExportColumnsForGridField(GridField $gridField)
    {
        if ($this->exportColumns) {
            return $this->exportColumns;
        }

        /** @var GridFieldDataColumns $dataCols */
        $dataCols = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
        if ($dataCols) {
            return $dataCols->getDisplayFields($gridField);
        }

        return DataObject::singleton($gridField->getModelClass())->summaryFields();
    }
protected function getExportColumnsForGridField ( GridField $ gridField ) { if ( $ this -> exportColumns ) { return $ this -> exportColumns ; } /** @var GridFieldDataColumns $dataCols */ $ dataCols = $ gridField -> getConfig ( ) -> getComponentByType ( GridFieldDataColumns :: class ) ; if ( $ dataCols ) { return $ dataCols -> getDisplayFields ( $ gridField ) ; } return DataObject :: singleton ( $ gridField -> getModelClass ( ) ) -> summaryFields ( ) ; }
Return the columns to export

@param GridField $gridField

@return array
Return the columns to export