Skip to content

Column options

plokko edited this page Nov 29, 2021 · 2 revisions
  • label(string|null $value) - Label of the column, used in headers (note: if none is specified it will be used the label from global translations or field name)

  • field(string|null|\Illuminate\Database\Query\Expression $value) - Set the table field used for select (and filtering or sorting if not explicit), defaults to table name if not set.

  • type(string|null type) - Set field type (ex. boolean, email, etc.) for formatting

  • align(string|null type) - Set header alignment (left|center|right)

  • component(string|null $component) - Set field component (in render)

  • rowClass(string|null $class) - Set row (CSS) class

  • cellClass(string|null $class) - Set cell (CSS) class

  • visible(bool $visible) - Sets the column visibility

  • virtual(bool $virtual) - Sets the column as virtual (no corresponding table field, ex. table actions)

  • columnView(null|string|\Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|Closure $view) - Sets the column view

  • virtual(bool $virtual) - Sets the column as virtua (no corresponding table field, ex. table actions)

  • attr(string $key,mixed $value) - Set one field attribute as key-value

  • setAttrs(array $attributes) - Set all attributes as a key-value array

  • sort(boolean|null|string|\Illuminate\Database\Query\Expression $field,[boolean $reverse]) - Makes the column sortable, first argument is table field (null or false to disable sorting, true to use base field or string or Expression to specify sorted field). If $reverse is set to true the sorting will be reversed (asc. when desc and vice versa)

  • filter(string|boolean|Closure $condition='=',null|string|\Illuminate\Database\Query\Expression $field=null) - Makes the column filterable, $condition specifies the condition to use and $field specifies the field to use (defaults to base field if null)

  • remove() - Alias of removeColumn('<column-name>'), removes the column

Clone this wiki locally