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.

static protected Collection $originalGridModels

Original grid data.

static protected array $htmlAttributes
static protected array $rowAttributes
static protected Model $model
protected Grid $grid
string $name
string $label
string $template
string $original
protected array $attributes

Attributes of column.

protected bool|string $relation

Relation name.

protected string $relationColumn

Relation column.

protected $displayCallbacks
string $sortable
protected bool $searchable
string $style
string $width
string $fixed
string $editable

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

disableEscape()

No description

enableEscape()

No description

setModel($model)

Set model for column.

style(string $style = '')

Set style of this column.

template(string $tmpl = '')

No description

width(string|int $width, bool $min = false)

Set the width of column.

widthAsId()

No description

widthAsIp()

No description

widthAsDatetime()

No description

widthAsNote()

No description

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.

array
lay()

No description

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.

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

Set relation.

bool
isRelation()

If this column is relation column.

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.

array|string
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 $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 213
__construct(string $name, string $label = '')

No description

Parameters

string $name
string $label

at line 224
setGrid(Grid $grid)

Set grid instance for column.

Parameters

Grid $grid

at line 231
Column editable()

No description

Return Value

Column

at line 238
Column disableEscape()

No description

Return Value

Column

at line 244
Column enableEscape()

No description

Return Value

Column

at line 256
setModel($model)

Set model for column.

Parameters

$model

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

Set style of this column.

Parameters

string $style

Return Value

Column

at line 276
Column template(string $tmpl = '')

No description

Parameters

string $tmpl

Return Value

Column

at line 288
Column width(string|int $width, bool $min = false)

Set the width of column.

Parameters

string|int $width
bool $min

Return Value

Column

at line 296
Column widthAsId()

No description

Return Value

Column

at line 301
Column widthAsIp()

No description

Return Value

Column

at line 306
Column widthAsDatetime()

No description

Return Value

Column

at line 311
Column widthAsNote()

No description

Return Value

Column

at line 320
Column sortable()

标识列为可排序

Return Value

Column

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

标识列为可fix 显示

Parameters

string $position

Return Value

Column

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

Set column filter.

Parameters

null $builder

Return Value

$this

at line 355
$this searchable()

Set column as searchable.

Return Value

$this

at line 378
bindSearchQuery(Model $model)

Bind search query to grid model.

Parameters

Model $model

at line 394
$this display(Closure $callback)

Add a display callback.

Parameters

Closure $callback

Return Value

$this

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

Display using display abstract.

Parameters

string $abstract
array $arguments

Return Value

$this

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

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

Parameters

array $values
string $default

Return Value

Column

at line 447
$this view(string $view)

Render this column with the given view.

Parameters

string $view

Return Value

$this

at line 460
Column hide()

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

Return Value

Column

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

Add column to total-row.

Parameters

null $display

Return Value

$this

at line 485
Column filesize()

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

Return Value

Column

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

使用 gravatar 来显示头像图

Parameters

int $size

Return Value

Column

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

Display field as a loading icon.

Parameters

array $values
array $others

Return Value

$this

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

Return a human readable format time.

Parameters

null $locale

Return Value

Column

at line 552
Column date(string $format)

Returns a string formatted according to the given format string.

Parameters

string $format

Return Value

Column

at line 567
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 583
Column action(string $action)

Display column using a grid row action.

Parameters

string $action

Return Value

Column

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

Add a dot before column text.

Parameters

array $options
string $default

Return Value

Column

at line 625
array lay()

No description

Return Value

array

at line 662
mixed fill(array $data)

Fill all data to every column.

Parameters

array $data

Return Value

mixed

at line 694
$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 712
string __get(string $key)

获取类属性

Parameters

string $key

Return Value

string

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

Extend column displayer.

Parameters

$name
$displayer

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

Define a column globally.

Parameters

string $name
mixed $definition

at line 744
static setOriginalGridModels(Collection $collection)

设置列的原始数据

Parameters

Collection $collection

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

Get column attributes.

Parameters

string $name
$key

Return Value

mixed

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

Set relation.

Parameters

string $relation
string $relationColumn

Return Value

$this

at line 790
protected bool isRelation()

If this column is relation column.

Return Value

bool

at line 800
protected bool hasDisplayCallbacks()

If has display callbacks.

Return Value

bool

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

Call all of the "display" callbacks column.

Parameters

mixed $value
int $key

Return Value

mixed

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

Set original grid data to column.

Parameters

Closure $callback
int $key

Return Value

Closure

at line 852
protected bool isDefinedColumn()

If current column is a defined column.

Return Value

bool

at line 862
protected useDefinedColumn()

Use a defined column.

Exceptions

Exception

at line 896
protected array|string htmlEntityEncode(array|string $item)

Convert characters to HTML entities recursively.

Parameters

array|string $item

Return Value

array|string

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

Find a displayer to display column.

Parameters

string $method
array $arguments

Return Value

Column

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

Call Illuminate/Support displayer.

Parameters

string $method
array $arguments

Return Value

Column

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

Call Builtin displayer.

Parameters

string $abstract
array $arguments

Return Value

Column

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

No description

Parameters

) $$states

Return Value

$this

at line 53
$this image(mixed $width, mixed $height)

No description

Parameters

mixed $width
mixed $height

Return Value

$this

No description

Parameters

mixed $href
mixed $target

Return Value

$this

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

No description

Parameters

mixed $style
mixed $size
mixed $max

Return Value

$this

at line 53
$this downloadable(mixed $server)

No description

Parameters

mixed $server

Return Value

$this

at line 53
$this copyable()

No description

Return Value

$this

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

No description

Parameters

mixed $formatter
mixed $width
mixed $height

Return Value

$this

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

No description

Parameters

mixed $prefix
mixed $delimiter

Return Value

$this

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

No description

Parameters

mixed $suffix
mixed $delimiter

Return Value

$this