Methods
The Column class provides several methods to manipulate a column in the grid.
setFilter(BaseFilter $filter)
setFilter(BaseFilter $filter)This method sets a filter for the column. Available filters are: TextFilter, DateFilter, SelectFilter, BooleanFilter.
public function setFilter(BaseFilter $filter): staticsetRecordField(?string $recordField)
setRecordField(?string $recordField)This method sets the model field of the column.
public function setRecordField(?string $recordField): voidsetSortable($isSortable = true)
setSortable($isSortable = true)This method enables or disables sorting for a column.
public function setSortable($isSortable = true): staticsetDateFormat(string $dateFormat)
setDateFormat(string $dateFormat)This method sets the date format used to display date values in the column.
public function setDateFormat(string $dateFormat): staticsetTag(string $tag): static
setTag(string $tag): staticThis method sets the tag of the column. The default tag is td.
public function setTag(string $tag): staticsetRenderer(callable $renderer): static
setRenderer(callable $renderer): staticThis method sets the renderer for the column. You can pass a callable, a class method, or a string.
setAttributes(array $attributes): static
setAttributes(array $attributes): staticThis method sets the attributes of the column. The attributes are HTML attributes that are applied to the column tag. You can pass a callable, a class method or an array.
Last updated
Was this helpful?