Modify the list of columns displayed in the table.
See {@link GridFieldDataColumns->getDisplayFields()} and {@link GridFieldDataColumns}.

@param GridField $gridField
@param array - List reference of all column names.
506328
public function augmentColumns($gridField, &$columns)
    {
        $baseColumns = array_keys($this->getDisplayFields($gridField));

        foreach ($baseColumns as $col) {
            $columns[] = $col;
        }

        $columns = array_unique($columns);
    }
723155
public function addField(Field $field)
    {
        if (array_search($field, $this->fields) === false)
            $this->fields[] = $field;
    }
146036
public function getSearchForm(GridField $gridField)
    {
        $searchContext = $this->getSearchContext($gridField);
        $searchFields = $searchContext->getSearchFields();

        if ($searchFields->count() === 0) {
            return null;
        }

        if ($this->searchForm) {
            return $this->searchForm;
        }

        // Append a prefix to search field names to prevent conflicts with other fields in the search form
        foreach ($searchFields as $field) {
            $field->setName('Search__' . $field->getName());
        }

        $columns = $gridField->getColumns();

        // Update field titles to match column titles
        foreach ($columns as $columnField) {
            $metadata = $gridField->getColumnMetadata($columnField);
            // Get the field name, without any modifications
            $name = explode('.', $columnField);
            $title = $metadata['title'];
            $field = $searchFields->fieldByName($name[0]);

            if ($field) {
                $field->setTitle($title);
            }
        }

        foreach ($searchFields->getIterator() as $field) {
            $field->addExtraClass('stacked');
        }

        $name = $gridField->Title ?: singleton($gridField->getModelClass())->i18n_plural_name();

        $this->searchForm = $form = new Form(
            $gridField,
            $name . "SearchForm",
            $searchFields,
            new FieldList()
        );

        $form->setFormMethod('get');
        $form->setFormAction($gridField->Link());
        $form->addExtraClass('cms-search-form form--no-dividers');
        $form->disableSecurityToken(); // This form is not tied to session so we disable this
        $form->loadDataFrom($searchContext->getSearchParams());

        if ($this->updateSearchFormCallback) {
            call_user_func($this->updateSearchFormCallback, $form);
        }

        return $this->searchForm;
    }
1238014
public function getColumnContent($gridField, $record, $columnName)
    {
        $data = new ArrayData(array(
            'Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'edit')
        ));
        return $data->renderWith(GridFieldEditButton::class);
    }
1151263
protected function addColumn($field)
    {
        // Let's see if they're setting
        // a limit, like: string[50]
        if ( str_contains($field->type, '[') )
        {
            preg_match('/([^\[]+?)\[(\d+)\]/', $field->type, $matches);
            $field->type = $matches[1]; // string
            $field->limit = $matches[2]; // 50
        }

        // We'll start building the appropriate Schema method
        $html = "\$table->{$field->type}";

        $html .= isset($field->limit)
            ? "('{$field->name}', {$field->limit})"
            : "('{$field->name}')";

        // Take care of any potential indexes or options
        if (isset($field->options))
        {
            $html .= $field->options;
        }

        return $html.';';
    }
1022471
protected function map($fields)
    {
        $list = [];
        if (count($this->columns) !== count($fields)) {
            throw new \RuntimeException('Column mismatch on line ' . $this->line);
        }
        foreach ($this->columns as $column) {
            $list[$column] = array_shift($fields);
        }
        return $list;
    }
1257523
protected function changeColumnOrder()
    {
        /**
         * @var GridFieldDataColumns $columns
         */
        $columns = $this->getComponentByType(GridFieldDataColumns::class);

        $columns->setDisplayFields(
            [
                'Title'          => _t(__CLASS__ . '.Title', 'Title'),
                'BlogPostsCount' => _t(__CLASS__ . '.Posts', 'Posts'),
                'MergeAction'    => 'MergeAction',
                'Actions'        => 'Actions'
            ]
        );
    }
230069
public function updateCMSFields(FieldList $fields)
    {
        /** Setup new Root Fieldlist */
        $fields->removeByName('Main');
        $owner = $this->owner;
        /** Add the fields */
        $fields->addFieldsToTab(
            'Root', // To what tab
            Tab::create(
                'Main', // Name
                _t('Tag.MAIN', 'Main'), // Title
                /** Fields */
                $text = TextField::create('Title', $owner->fieldLabel('Title')), $html = HTMLEditorField::create('Description', $owner->fieldLabel('Description')), $uplo = UploadField::create('Impression', $owner->fieldLabel('Impression'))
            )
        );
    }
1190714
private void updateFields() {
		if (featureInfo != null) {
			// Create a header field for each attribute definition:
			List<ListGridField> fields = new ArrayList<ListGridField>();
			if (idInTable) {
				ListGridField gridField = new ListGridField(ID_NAME, "ID");
				gridField.setAlign(Alignment.LEFT);
				gridField.setCanEdit(false);
				fields.add(gridField);
			}

			for (AttributeInfo attributeInfo : featureInfo.getAttributes()) {
				if (!attributeInfo.isHidden() && (attributeInfo.isIdentifying() || allAttributesDisplayed)) {
					fields.add(createAttributeGridField(attributeInfo));
				}
			}
			setFields(fields.toArray(new ListGridField[fields.size()]));
			setCanResizeFields(true);
		}
	}
142854
protected function fixSortColumn($gridField, SS_List $dataList)
    {
        if ($dataList instanceof UnsavedRelationList) {
            return;
        }

        /** @var SS_List|DataList $list */
        $list = clone $dataList;
        $list = $list->alterDataQuery(function ($query, SS_List $tmplist) {
            /** @var DataQuery $query */
            $query->limit(array());
            return $query;
        });

        $many_many = ($list instanceof ManyManyList || $list instanceof ManyManyThroughList);
        if (!$many_many) {
            $sng = singleton($gridField->getModelClass());
            $fieldType = $sng->config()->db[$this->sortColumn];

            if (!$fieldType || !($fieldType == 'Int' || $fieldType == 'SilverStripe\\ORM\\FieldType\\DBInt' || is_subclass_of($fieldType, 'SilverStripe\\ORM\\FieldType\\DBInt'))) {
                if (is_array($fieldType)) {
                    user_error('Sort column ' . $this->sortColumn . ' could not be found in ' . $gridField->getModelClass() . '\'s ancestry', E_USER_ERROR);
                } else {
                    user_error('Sort column ' . $this->sortColumn . ' must be an instance of SilverStripe\\ORM\\FieldType\\DBInt, column is of type ' . $fieldType, E_USER_ERROR);
                }

                exit;
            }
        }

        $max = $list->Max($this->sortColumn);
        $list = $list->filter($this->sortColumn, 0)->sort("Created,ID");
        if ($list->Count() > 0) {
            $owner = $gridField->getForm()->getRecord();
            $sortColumn = $this->sortColumn;
            $i = 1;

            if ($many_many) {
                $schema=Injector::inst()->get(DataObjectSchema::class);
                $componentDetails=$schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
                $parentField=$componentDetails['parentField'];
                $componentField=$componentDetails['childField'];
                $table=$componentDetails['join'];
                
                //For ManyManyThroughLists get the right join table
                if ($list instanceof ManyManyThroughList && class_exists($table)) {
                    $table=$schema->tableName($table);
                }

                $extraFields = $list->getExtraFields();

                if (!$extraFields || !array_key_exists($this->sortColumn, $extraFields) || !($extraFields[$this->sortColumn] == 'Int' || $extraFields[$this->sortColumn] == 'SilverStripe\\ORM\\FieldType\\DBInt' || is_subclass_of('SilverStripe\\ORM\\FieldType\\DBInt', $extraFields[$this->sortColumn]))) {
                    user_error('Sort column ' . $this->sortColumn . ' must be an SilverStripe\\ORM\\FieldType\\DBInt, column is of type ' . $extraFields[$this->sortColumn], E_USER_ERROR);
                    exit;
                }
            } else {
                //Find table containing the sort column
                $table = false;
                $class = $gridField->getModelClass();

                $db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
                if (!empty($db) && array_key_exists($sortColumn, $db)) {
                    $table = DataObject::getSchema()->tableName($class);
                } else {
                    $classes = ClassInfo::ancestry($class, true);
                    foreach ($classes as $class) {
                        $db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
                        if (!empty($db) && array_key_exists($sortColumn, $db)) {
                            $table = DataObject::getSchema()->tableName($class);
                            break;
                        }
                    }
                }

                if ($table === false) {
                    user_error('Sort column ' . $this->sortColumn . ' could not be found in ' . $gridField->getModelClass() . '\'s ancestry', E_USER_ERROR);
                    exit;
                }

                $baseDataClass = DataObject::getSchema()->baseDataClass($gridField->getModelClass());
                $baseDataTable = DataObject::getSchema()->tableName($baseDataClass);
            }


            //Start transaction if supported
            if (DB::get_conn()->supportsTransactions()) {
                DB::get_conn()->transactionStart();
            }

            $idCondition = null;
            if ($this->append_to_top && !($list instanceof RelationList)) {
                $idCondition = '"ID" IN(\'' . implode("','", $dataList->getIDList()) . '\')';
            }

            if ($this->append_to_top) {
                $topIncremented = array();
            }

            $modelClass = $gridField->getModelClass();
            $hasVersioned = $this->hasVersionedExtension($modelClass);
            foreach ($list as $obj) {
                if ($many_many) {
                    if ($this->append_to_top) {
                        //Upgrade all the records (including the last inserted from 0 to 1)
                        DB::query('UPDATE "' . $table
                            . '" SET "' . $sortColumn . '" = "' . $sortColumn . '"+1'
                            . ' WHERE "' . $parentField . '" = ' . $owner->ID . (!empty($topIncremented) ? ' AND "' . $componentField . '" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));

                        $topIncremented[] = $obj->ID;
                    } else {
                        //Append the last record to the bottom
                        DB::query('UPDATE "' . $table
                            . '" SET "' . $sortColumn . '" = ' . ($max + $i)
                            . ' WHERE "' . $componentField . '" = ' . $obj->ID . ' AND "' . $parentField . '" = ' . $owner->ID);
                    }
                } else if ($this->append_to_top) {
                    if ($hasVersioned) {
                        // For versioned objects, modify them with the ORM so that the *_versions table is updated
                        $itemsToUpdate = $modelClass::get()->where(($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
                        if ($itemsToUpdate->exists()) {
                            foreach ($itemsToUpdate as $item) {
                                $item->$sortColumn = $item->$sortColumn + 1;
                                $item->write();
                            }
                        }
                    }else {
                        //Upgrade all the records (including the last inserted from 0 to 1)
                        DB::query('UPDATE "' . $table
                            . '" SET "' . $sortColumn . '" = "' . $sortColumn . '"+1'
                            . ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
                    }

                    if ($this->update_versioned_stage && $this->hasVersionedExtension($gridField->getModelClass())) {
                        DB::query('UPDATE "' . $table . '_' . $this->update_versioned_stage
                            . '" SET "' . $sortColumn . '" = "' . $sortColumn . '"+1'
                            . ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
                    }

                    $topIncremented[] = $obj->ID;
                } else {
                    if ($hasVersioned) {
                        // For versioned objects, modify them with the ORM so that the *_versions table is updated
                        $obj->$sortColumn = ($max + $i);
                        $obj->write();
                    } else {
                        //Append the last record to the bottom
                        DB::query('UPDATE "' . $table
                            . '" SET "' . $sortColumn . '" = ' . ($max + $i)
                            . ' WHERE "ID" = ' . $obj->ID);

                        //LastEdited
                        DB::query('UPDATE "' . $baseDataTable
                            . '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
                            . ' WHERE "ID" = ' . $obj->ID);
                    }

                    if ($this->update_versioned_stage && $this->hasVersionedExtension($gridField->getModelClass())) {
                        DB::query('UPDATE "' . $table . '_' . $this->update_versioned_stage
                            . '" SET "' . $sortColumn . '" = ' . ($max + $i)
                            . ' WHERE "ID" = ' . $obj->ID);

                        if ($this->hasVersionedExtension($baseDataClass)) {
                            DB::query('UPDATE "' . $baseDataTable . '_' . $this->update_versioned_stage
                                . '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
                                . ' WHERE "ID" = ' . $obj->ID);
                        }
                    }
                }

                $i++;
            }

            //Update LastEdited for affected records when using append to top on a many_many relationship
            if (!$many_many && $this->append_to_top && count($topIncremented) > 0) {
                DB::query('UPDATE "' . $baseDataTable
                    . '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
                    . ' WHERE "ID" IN(\'' . implode('\',\'', $topIncremented) . '\')');

                if ($this->update_versioned_stage && $this->hasVersionedExtension($gridField->getModelClass()) && $this->hasVersionedExtension($baseDataClass)) {
                    DB::query('UPDATE "' . $baseDataTable . '_' . $this->update_versioned_stage
                        . '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
                        . ' WHERE "ID" IN(\'' . implode('\',\'', $topIncremented) . '\')');
                }
            }


            //End transaction if supported
            if (DB::get_conn()->supportsTransactions()) {
                DB::get_conn()->transactionEnd();
            }
        }
    }
235903
public function updateCMSFields(FieldList $fields) {
		$excluded = $this->owner->getExcludedSiteTreeClassNames();
		if(!empty($excluded)) {
			$pages = SiteTree::get()->filter(array(
				'ParentID' => $this->owner->ID,
				'ClassName' => $excluded
			));
			$gridField = new GridField(
				"ChildPages",
				$this->getLumberjackTitle(),
				$pages,
				GridFieldConfig_Lumberjack::create()
			);

			$tab = new Tab('ChildPages', $this->getLumberjackTitle(), $gridField);
			$fields->insertAfter($tab, 'Main');
		}
	}
643104
public function getTemplateParameters(GridField $gridField)
    {
        $state = $this->getGridPagerState();
        if (is_numeric($state->pageSize)) {
            $this->setItemsPerPage($state->pageSize);
        }
        $arguments = $this->getPagerArguments();

        // Figure out which page and record range we're on
        if (!$arguments['total-rows']) {
            return null;
        }

        // Define a list of the FormActions that should be generated for pager controls (see getPagerActions())
        $controls = array(
            'first' => array(
                'title' => 'First',
                'args' => array('first-shown' => 1),
                'extra-class' => 'btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-left '
                    . 'ss-gridfield-pagination-action ss-gridfield-firstpage',
                'disable-previous' => ($this->getCurrentPage() == 1)
            ),
            'prev' => array(
                'title' => 'Previous',
                'args' => array('first-shown' => $arguments['first-shown'] - $this->getItemsPerPage()),
                'extra-class' => 'btn btn-secondary btn--hide-text btn-sm font-icon-angle-left '
                    . 'ss-gridfield-pagination-action ss-gridfield-previouspage',
                'disable-previous' => ($this->getCurrentPage() == 1)
            ),
            'next' => array(
                'title' => 'Next',
                'args' => array('first-shown' => $arguments['first-shown'] + $this->getItemsPerPage()),
                'extra-class' => 'btn btn-secondary btn--hide-text btn-sm font-icon-angle-right '
                .'ss-gridfield-pagination-action  ss-gridfield-nextpage',
                'disable-next' => ($this->getCurrentPage() == $arguments['total-pages'])
            ),
            'last' => array(
                'title' => 'Last',
                'args' => array('first-shown' => ($this->getTotalPages() - 1) * $this->getItemsPerPage() + 1),
                'extra-class' => 'btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-right '
                    . 'ss-gridfield-pagination-action ss-gridfield-lastpage',
                'disable-next' => ($this->getCurrentPage() == $arguments['total-pages'])
            ),
            'pagesize' => array(
                'title' => 'Page Size',
                'args' => array('first-shown' => $arguments['first-shown']),
                'extra-class' => 'ss-gridfield-pagination-action ss-gridfield-pagesize-submit'
            ),
        );

        if ($controls['prev']['args']['first-shown'] < 1) {
            $controls['prev']['args']['first-shown'] = 1;
        }

        $actions = $this->getPagerActions($controls, $gridField);

        // Render in template
        return ArrayData::create(array(
            'OnlyOnePage' => ($arguments['total-pages'] == 1),
            'FirstPage' => $actions['first'],
            'PreviousPage' => $actions['prev'],
            'NextPage' => $actions['next'],
            'LastPage' => $actions['last'],
            'PageSizesSubmit' => $actions['pagesize'],
            'CurrentPageNum' => $this->getCurrentPage(),
            'NumPages' => $arguments['total-pages'],
            'FirstShownRecord' => $arguments['first-shown'],
            'LastShownRecord' => $arguments['last-shown'],
            'NumRecords' => $arguments['total-rows'],
            'PageSizes' => $this->getPageSizesAsList(),
            'PageSizesName' => $gridField->getName() . '[page-sizes]',
        ));
    }
792340
protected function getPrintColumnsForGridField(GridField $gridField)
    {
        if ($this->printColumns) {
            return $this->printColumns;
        }

        /** @var GridFieldDataColumns $dataCols */
        $dataCols = $gridField->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
        if ($dataCols) {
            return $dataCols->getDisplayFields($gridField);
        }

        return DataObject::singleton($gridField->getModelClass())->summaryFields();
    }
1136649
public function getFields(GridField $grid, DataObjectInterface $record)
    {
        $cols   = $this->getDisplayFields($grid);
        $fields = new FieldList();

        /** @var DataList $list */
        $list   = $grid->getList();
        $class  = $list ? $list->dataClass() : null;

        foreach ($cols as $col => $info) {
            $field = null;

            if ($info instanceof Closure) {
                $field = call_user_func($info, $record, $col, $grid);
            } elseif (is_array($info)) {
                if (isset($info['callback'])) {
                    $field = call_user_func($info['callback'], $record, $col, $grid);
                } elseif (isset($info['field'])) {
                    if ($info['field'] == LiteralField::class) {
                        $field = new $info['field']($col, null);
                    } else {
                        $field = new $info['field']($col);
                    }
                }

                if (!$field instanceof FormField) {
                    throw new Exception(sprintf(
                        'The field for column "%s" is not a valid form field',
                        $col
                    ));
                }
            }

            if (!$field && $list instanceof ManyManyList) {
                $extra = $list->getExtraFields();

                if ($extra && array_key_exists($col, $extra)) {
                    $field = Injector::inst()->create($extra[$col], $col)->scaffoldFormField();
                }
            }

            if (!$field) {
                if (!$this->displayFields) {
                    // If setDisplayFields() not used, utilize $summary_fields
                    // in a way similar to base class
                    //
                    // Allows use of 'MyBool.Nice' and 'MyHTML.NoHTML' so that
                    // GridFields not using inline editing still look good or
                    // revert to looking good in cases where the field isn't
                    // available or is readonly
                    //
                    $colRelation = explode('.', $col);
                    if ($class && $obj = DataObject::singleton($class)->dbObject($colRelation[0])) {
                        $field = $obj->scaffoldFormField();
                    } else {
                        $field = new ReadonlyField($colRelation[0]);
                    }
                } elseif ($class && $obj = DataObject::singleton($class)->dbObject($col)) {
                    $field = $obj->scaffoldFormField();
                } else {
                    $field = new ReadonlyField($col);
                }
            }

            if (!$field instanceof FormField) {
                throw new Exception(sprintf(
                    'Invalid form field instance for column "%s"',
                    $col
                ));
            }

            // Add CSS class for interactive fields
            if (!($field->isReadOnly() || $field instanceof LiteralField)) {
                $field->addExtraClass('editable-column-field');
            }

            $fields->push($field);
        }

        return $fields;
    }
142338
protected function outputRows(GridField $gridField, $columns, $start, $count)
    {
        $csvWriter = $this->getCSVWriter();

        $items = $gridField->getManipulatedList();
        $items = $items->limit($count, $start);

        foreach ($items as $item) {
            if (!$item->hasMethod('canView') || $item->canView()) {
                $columnData = [];

                foreach ($columns as $columnSource => $columnHeader) {
                    if (!is_string($columnHeader) && is_callable($columnHeader)) {
                        if ($item->hasMethod($columnSource)) {
                            $relObj = $item->{$columnSource}();
                        } else {
                            $relObj = $item->relObject($columnSource);
                        }

                        $value = $columnHeader($relObj);
                    } else {
                        $value = $gridField->getDataFieldValue($item, $columnSource);

                        if ($value === null) {
                            $value = $gridField->getDataFieldValue($item, $columnHeader);
                        }
                    }

                    $columnData[] = $value;
                }

                $csvWriter->insertOne($columnData);
            }

            if ($item->hasMethod('destroy')) {
                $item->destroy();
            }
        }
    }
487625
public function updateField($field)
    {
        if (!$field instanceof ObjectField)
        {
            throw new FieldEditorException(print_r($field, true) . " is not of type ObjectField");
        }
        foreach ($this->_fields as $column => $fields)
        {
            foreach ($fields as $index => $f)
            {
                $existing_field = $f->getField();
                if ($existing_field !== null && $field->getField() === $existing_field)
                {
                    // If the field name (f1234) exists merge replace on that.
                    $this->_fields[$column][$index] = $field;
                    return;
                }
            }
        }
        throw new FieldEditorException("Could not find an existing field: {$field->getField()} in this Section");
    }
1298044
public function getLegacyFilterHeader(GridField $gridField)
    {
        Deprecation::notice('5.0', 'Table row based filter header will be removed in favor of search field in 5.0');

        $list = $gridField->getList();
        if (!$this->checkDataType($list)) {
            return null;
        }

        $columns = $gridField->getColumns();
        $filterArguments = $gridField->State->GridFieldFilterHeader->Columns->toArray();
        $currentColumn = 0;
        $canFilter = false;
        $fieldsList = new ArrayList();

        foreach ($columns as $columnField) {
            $currentColumn++;
            $metadata = $gridField->getColumnMetadata($columnField);
            $title = $metadata['title'];
            $fields = new FieldGroup();

            if ($title && $list->canFilterBy($columnField)) {
                $canFilter = true;

                $value = '';
                if (isset($filterArguments[$columnField])) {
                    $value = $filterArguments[$columnField];
                }
                $field = new TextField('filter[' . $gridField->getName() . '][' . $columnField . ']', '', $value);
                $field->addExtraClass('grid-field__sort-field');
                $field->addExtraClass('no-change-track');

                $field->setAttribute(
                    'placeholder',
                    _t('SilverStripe\\Forms\\GridField\\GridField.FilterBy', "Filter by ") . _t('SilverStripe\\Forms\\GridField\\GridField.' . $metadata['title'], $metadata['title'])
                );

                $fields->push($field);
                $fields->push(
                    GridField_FormAction::create($gridField, 'reset', false, 'reset', null)
                        ->addExtraClass('btn font-icon-cancel btn-secondary btn--no-text ss-gridfield-button-reset')
                        ->setAttribute('title', _t('SilverStripe\\Forms\\GridField\\GridField.ResetFilter', "Reset"))
                        ->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField)
                );
            }

            if ($currentColumn == count($columns)) {
                $fields->push(
                    GridField_FormAction::create($gridField, 'filter', false, 'filter', null)
                        ->addExtraClass('btn font-icon-search btn--no-text btn--icon-large grid-field__filter-submit ss-gridfield-button-filter')
                        ->setAttribute('title', _t('SilverStripe\\Forms\\GridField\\GridField.Filter', 'Filter'))
                        ->setAttribute('id', 'action_filter_' . $gridField->getModelClass() . '_' . $columnField)
                );
                $fields->push(
                    GridField_FormAction::create($gridField, 'reset', false, 'reset', null)
                        ->addExtraClass('btn font-icon-cancel btn--no-text grid-field__filter-clear btn--icon-md ss-gridfield-button-close')
                        ->setAttribute('title', _t('SilverStripe\\Forms\\GridField\\GridField.ResetFilter', "Reset"))
                        ->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField)
                );
                $fields->addExtraClass('grid-field__filter-buttons');
                $fields->addExtraClass('no-change-track');
            }

            $fieldsList->push($fields);
        }

        return $canFilter ? $fieldsList : null;
    }