class Column

Class Column.

Traits

Constants

NAME_SELECTOR

NAME_ACTION

Properties

Filter $filter from  HasHeader
protected array $headers from  HasHeader
static array $displayers

Displayer for grid column.

static array $defined

Defined columns.

protected Grid $grid
string $name
string $label
string $original
protected array $attributes

Attributes of column.

protected bool $relation

Relation name.

protected string $relationColumn

Relation column.

protected $displayCallbacks
string $sortable
protected bool $searchable
string $style
string $width
static protected Collection $originalGridModels

Original grid data.

static protected array $htmlAttributes
static protected array $rowAttributes
static protected Model $model
string $fixed
string $editable
string $template

Methods

$this
addHeader(string|Renderable|Htmlable $header)

Add contents to column header.

bindFilterQuery(Model $model)

Add a binding based on filter to the model query.

string
renderHeader()

Render Column header.

getHeader()

No description

$this
addFilter($type = null, $formal = null)

Add a filter to column header.

__construct(string $name, string $label = '')

No description

setGrid(Grid $grid)

Set grid instance for column.

editable()

No description

setModel($model)

Set model for column.

style(string $style = '')

Set style of this column.

width(string|int $width)

Set the width of column.

sortable()

标识列为可排序

fixed(string $position = 'right')

标识列为可fix 显示

$this
filter(null $builder = null)

Set column filter.

$this
searchable()

Set column as searchable.

bindSearchQuery(Model $model)

Bind search query to grid model.

$this
display(Closure $callback)

Add a display callback.

$this
displayUsing(string $abstract, array $arguments = [])

Display using display abstract.

using(array $values, string $default = '')

替换输出, 并指定默认值, 可以用于状态值替换, 使用KV

$this
view(string $view)

Render this column with the given view.

hide()

当前列存在, 但是数据暂时隐藏掉

$this
totalRow(null $display = null)

Add column to total-row.

filesize()

Convert file size to a human readable format like 100mb.

gravatar(int $size = 25)

使用 gravatar 来显示头像图

$this
loading(array $values = [], array $others = [])

Display field as a loading icon.

diffForHumans(null $locale = null)

Return a human readable format time.

date(string $format)

Returns a string formatted according to the given format string.

bool(array $map = [], bool $default = false)

Display column as boolean , for true, and for false.

action(string $action)

Display column using a grid row action.

dot(array $options = [], string $default = '')

Add a dot before column text.

mixed
fill(array $data)

Fill all data to every column.

$this
__call(string $method, array $arguments)

Passes through all unknown calls to builtin displayer or supported displayer.

string
__get(string $key)

获取类属性

static 
extend($name, $displayer)

Extend column displayer.

static 
define(string $name, mixed $definition)

Define a column globally.

static 
setOriginalGridModels(Collection $collection)

设置列的原始数据

static mixed
getAttributes(string $name, $key = null)

Get column attributes.

bool
isRelation()

If this column is relation column.

$this
setRelation(string $relation, string $relationColumn = null)

Set relation.

bool
hasDisplayCallbacks()

If has display callbacks.

mixed
callDisplayCallbacks(mixed $value, int $key)

Call all of the "display" callbacks column.

bindOriginalRowModel(Closure $callback, int $key)

Set original grid data to column.

bool
isDefinedColumn()

If current column is a defined column.

useDefinedColumn()

Use a defined column.

mixed
htmlEntityEncode(array|string $item)

Convert characters to HTML entities recursively.

resolveDisplayer(string $method, array $arguments)

Find a displayer to display column.

callSupportDisplayer(string $method, array $arguments)

Call Illuminate/Support displayer.

callBuiltinDisplayer(string $abstract, array $arguments)

Call Builtin displayer.

$this
switch() $$states = [])

No description

$this
image(mixed $server, mixed $width, mixed $height)

No description

$this
link(mixed $href, mixed $target)

No description

$this
progress(mixed $style, mixed $size, mixed $max)

No description

$this
downloadable(mixed $server)

No description

$this
copyable()

No description

$this
qrcode(mixed $formatter, mixed $width, mixed $height)

No description

$this
prefix(mixed $prefix, mixed $delimiter)

No description

$this
suffix(mixed $suffix, mixed $delimiter)

No description

Details

in HasHeader at line 28
$this addHeader(string|Renderable|Htmlable $header)

Add contents to column header.

Parameters

string|Renderable|Htmlable $header

Return Value

$this

in HasHeader at line 44
bindFilterQuery(Model $model)

Add a binding based on filter to the model query.

Parameters

Model $model

in HasHeader at line 56
string renderHeader()

Render Column header.

Return Value

string

in HasHeader at line 71
getHeader()

No description

in HasHeader at line 81
protected $this addFilter($type = null, $formal = null)

Add a filter to column header.

Parameters

$type
$formal

Return Value

$this

at line 164
__construct(string $name, string $label = '')

No description

Parameters

string $name
string $label

at line 175
setGrid(Grid $grid)

Set grid instance for column.

Parameters

Grid $grid

at line 182
Column editable()

No description

Return Value

Column

at line 193
setModel($model)

Set model for column.

Parameters

$model

at line 207
Column style(string $style = '')

Set style of this column.

Parameters

string $style

Return Value

Column

at line 220
Column width(string|int $width)

Set the width of column.

Parameters

string|int $width

Return Value

Column

at line 230
Column sortable()

标识列为可排序

Return Value

Column

at line 241
Column fixed(string $position = 'right')

标识列为可fix 显示

Parameters

string $position

Return Value

Column

at line 254
$this filter(null $builder = null)

Set column filter.

Parameters

null $builder

Return Value

$this

at line 265
$this searchable()

Set column as searchable.

Return Value

$this

at line 288
bindSearchQuery(Model $model)

Bind search query to grid model.

Parameters

Model $model

at line 304
$this display(Closure $callback)

Add a display callback.

Parameters

Closure $callback

Return Value

$this

at line 319
$this displayUsing(string $abstract, array $arguments = [])

Display using display abstract.

Parameters

string $abstract
array $arguments

Return Value

$this

at line 339
Column using(array $values, string $default = '')

替换输出, 并指定默认值, 可以用于状态值替换, 使用KV

Parameters

array $values
string $default

Return Value

Column

at line 357
$this view(string $view)

Render this column with the given view.

Parameters

string $view

Return Value

$this

at line 370
Column hide()

当前列存在, 但是数据暂时隐藏掉

Return Value

Column

at line 383
$this totalRow(null $display = null)

Add column to total-row.

Parameters

null $display

Return Value

$this

at line 395
Column filesize()

Convert file size to a human readable format like 100mb.

Return Value

Column

at line 407
Column gravatar(int $size = 25)

使用 gravatar 来显示头像图

Parameters

int $size

Return Value

Column

at line 428
$this loading(array $values = [], array $others = [])

Display field as a loading icon.

Parameters

array $values
array $others

Return Value

$this

at line 445
Column diffForHumans(null $locale = null)

Return a human readable format time.

Parameters

null $locale

Return Value

Column

at line 463
Column date(string $format)

Returns a string formatted according to the given format string.

Parameters

string $format

Return Value

Column

at line 478
Column bool(array $map = [], bool $default = false)

Display column as boolean , for true, and for false.

Parameters

array $map
bool $default

Return Value

Column

at line 494
Column action(string $action)

Display column using a grid row action.

Parameters

string $action

Return Value

Column

at line 522
Column dot(array $options = [], string $default = '')

Add a dot before column text.

Parameters

array $options
string $default

Return Value

Column

at line 543
mixed fill(array $data)

Fill all data to every column.

Parameters

array $data

Return Value

mixed

at line 575
$this __call(string $method, array $arguments)

Passes through all unknown calls to builtin displayer or supported displayer.

Allow fluent calls on the Column object.

Parameters

string $method
array $arguments

Return Value

$this

at line 593
string __get(string $key)

获取类属性

Parameters

string $key

Return Value

string

at line 604
static extend($name, $displayer)

Extend column displayer.

Parameters

$name
$displayer

at line 615
static define(string $name, mixed $definition)

Define a column globally.

Parameters

string $name
mixed $definition

at line 625
static setOriginalGridModels(Collection $collection)

设置列的原始数据

Parameters

Collection $collection

at line 637
static mixed getAttributes(string $name, $key = null)

Get column attributes.

Parameters

string $name
$key

Return Value

mixed

at line 655
protected bool isRelation()

If this column is relation column.

Return Value

bool

at line 668
$this setRelation(string $relation, string $relationColumn = null)

Set relation.

Parameters

string $relation
string $relationColumn

Return Value

$this

at line 681
protected bool hasDisplayCallbacks()

If has display callbacks.

Return Value

bool

at line 694
protected mixed callDisplayCallbacks(mixed $value, int $key)

Call all of the "display" callbacks column.

Parameters

mixed $value
int $key

Return Value

mixed

at line 721
protected Closure bindOriginalRowModel(Closure $callback, int $key)

Set original grid data to column.

Parameters

Closure $callback
int $key

Return Value

Closure

at line 733
protected bool isDefinedColumn()

If current column is a defined column.

Return Value

bool

at line 743
protected useDefinedColumn()

Use a defined column.

Exceptions

Exception

at line 778
protected mixed htmlEntityEncode(array|string $item)

Convert characters to HTML entities recursively.

Parameters

array|string $item

Return Value

mixed

at line 800
protected Column resolveDisplayer(string $method, array $arguments)

Find a displayer to display column.

Parameters

string $method
array $arguments

Return Value

Column

at line 815
protected Column callSupportDisplayer(string $method, array $arguments)

Call Illuminate/Support displayer.

Parameters

string $method
array $arguments

Return Value

Column

at line 838
protected Column callBuiltinDisplayer(string $abstract, array $arguments)

Call Builtin displayer.

Parameters

string $abstract
array $arguments

Return Value

Column

at line 40
$this switch() $$states = [])

No description

Parameters

) $$states

Return Value

$this

at line 40
$this image(mixed $server, mixed $width, mixed $height)

No description

Parameters

mixed $server
mixed $width
mixed $height

Return Value

$this

No description

Parameters

mixed $href
mixed $target

Return Value

$this

at line 40
$this progress(mixed $style, mixed $size, mixed $max)

No description

Parameters

mixed $style
mixed $size
mixed $max

Return Value

$this

at line 40
$this downloadable(mixed $server)

No description

Parameters

mixed $server

Return Value

$this

at line 40
$this copyable()

No description

Return Value

$this

at line 40
$this qrcode(mixed $formatter, mixed $width, mixed $height)

No description

Parameters

mixed $formatter
mixed $width
mixed $height

Return Value

$this

at line 40
$this prefix(mixed $prefix, mixed $delimiter)

No description

Parameters

mixed $prefix
mixed $delimiter

Return Value

$this

at line 40
$this suffix(mixed $suffix, mixed $delimiter)

No description

Parameters

mixed $suffix
mixed $delimiter

Return Value

$this