Columns
trait Columns
Properties
| string | $column_id | The unique identifier column for rows. |
|
| string | $custom_column_id | A custom column ID override. |
|
| Collection|null | $columns | Collection of defined columns. |
|
| bool | $show_column_toggle | Whether to show the column toggle dropdown. |
|
| bool | $column_toggle_dd_status | Status of the column toggle dropdown (open/closed). |
|
| bool | $hasMobileCollapsedColumns | Indicates if there are columns collapsed on mobile view. |
|
| array | $mobileCollapsedColumns | Array of columns that are collapsed on mobile. |
Methods
Initialize and process column definitions.
Get a fresh collection of column instances with closures intact.
Resolve secondary header values by calling each column's callback with the current rows.
Show or hide the column toggle dropdown.
Set the primary key column used to identify rows.
Hide this column on mobile devices.
Show this column only on mobile devices.
Set CSS classes for the column's header wrapper element.
Set a closure that determines when the toggle should be disabled.
Set the display label/icon for the "false" state.
Open the link in a popup window with the given dimensions.
Hide this column from the column toggle selector.
Set an alternative column key to use when sorting this column.
Details
at line 53
void
setColumns()
Initialize and process column definitions.
Handles mobile visibility, collapse behavior, and strips closures for Livewire serialization.
at line 99
Collection
getFreshColumns()
Get a fresh collection of column instances with closures intact.
at line 114
array
resolveSecondaryHeaders(mixed $paginatedData)
Resolve secondary header values by calling each column's callback with the current rows.
at line 136
void
showColumnToggle(bool $bool)
Show or hide the column toggle dropdown.
at line 146
void
setColumnID(string $column_id)
Set the primary key column used to identify rows.
at line 154
Columns
hideOnMobile(bool $bool)
Hide this column on mobile devices.
at line 164
Columns
showOnMobile(bool $bool = true)
Show this column only on mobile devices.
at line 176
Columns
view(string $view)
Set a custom Blade view for rendering the column cell.
at line 187
Columns
styling(string $classes)
Set CSS classes for the column's table cell (td).
at line 197
Columns
thStyling(string $classes)
Set CSS classes for the column's table header (th).
at line 207
Columns
thWrapperStyling(string $classes)
Set CSS classes for the column's header wrapper element.
at line 217
Columns
disableToggleWhen(Closure $function)
Set a closure that determines when the toggle should be disabled.
at line 227
Columns
hideToggleWhen(Closure $function)
Set a closure that determines when the toggle should be hidden.
at line 237
Columns
trigger(string $trigger)
Set the method name to call when a toggle column is toggled.
at line 247
Columns
isBool()
Mark this column as a boolean column.
at line 259
Columns
trueIs(mixed $true)
Set the value that represents "true" for boolean columns.
at line 271
Columns
trueLabel(string $string)
Set the display label/icon for the "true" state.
at line 283
Columns
falseLabel(string $string)
Set the display label/icon for the "false" state.
at line 293
Columns
toHtml()
Allow the column value to be rendered as raw HTML.
at line 305
Columns
text(string $text)
Set the display text for a link column.
at line 329
Columns
target(string $target)
Set the target attribute for a link column (e.g. '_blank').
at line 343
Columns
popup(array $array = ['width' => 750, 'height' => 800])
Open the link in a popup window with the given dimensions.
at line 357
Columns
classes(string $classes)
Set CSS classes for a link column's anchor tag.
at line 369
Columns
customData(Closure $function)
Set a closure to transform the column's display value.
at line 379
Columns
hideWhen(bool $bool)
Conditionally hide the column and remove it from the column selector.
at line 392
Columns
hideFromSelector(bool $bool)
Hide this column from the column toggle selector.
at line 402
Columns
isVisible(bool $bool)
Set the column's initial visibility.
at line 412
Columns
sortColumnBy(string $column)
Set an alternative column key to use when sorting this column.