ModifyRecordListHeaderColumnsEvent

New in version 11.4

Changed in version 12.0

Due to the integration of EXT:recordlist into EXT:backend the namespace of the event changed from \TYPO3\CMS\Recordlist\Event\ModifyRecordListHeaderColumnsEvent to \TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent. For TYPO3 v12 the moved class is available as an alias under the old namespace to allow extensions to be compatible with TYPO3 v11 and v12.

The PSR-14 event \TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent allows to modify the header columns for a table in the record list.

Usage

See combined usage example.

API

class ModifyRecordListHeaderColumnsEvent
Fully qualified name
\TYPO3\CMS\Backend\RecordList\Event\ModifyRecordListHeaderColumnsEvent

An event to modify the header columns for a table in the RecordList

setColumn ( string $column, string $columnName = '')

Add a new column or override an existing one. Latter is only possible, in case $columnName is given. Otherwise, the column will be added with a numeric index, which is generally not recommended.

Note: Due to the behaviour of DatabaseRecordList, just adding a column does not mean that it is also displayed. The internal $fieldArray needs to be adjusted as well. This method only adds the column to the data array. Therefore, this method should mainly be used to edit existing columns, e.g. change their label.

param $column

the column

param $columnName

the columnName, default: ''

hasColumn ( string $columnName)

Whether the column exists

param $columnName

the columnName

Returns
bool
getColumn ( string $columnName)

Get column by its name

param $columnName

the columnName

Return description

The column or NULL if the column does not exist

Returns
string|null
removeColumn ( string $columnName)

Remove column by its name

param $columnName

the columnName

Return description

Whether the column could be removed - Will thereforereturn FALSE if the column to remove does not exist.

Returns
bool
setColumns ( array $columns)
param $columns

the columns

getColumns ( )
Returns
array
setHeaderAttributes ( array $headerAttributes)
param $headerAttributes

the headerAttributes

getHeaderAttributes ( )
Returns
array
getTable ( )
Returns
string
getRecordIds ( )
Returns
array
getRecordList ( )

Returns the current DatabaseRecordList instance.

Returns
\TYPO3\CMS\Backend\RecordList\DatabaseRecordList