Column
class Column implements Structable
列展示以及渲染, 当前的目的是使用前端方式渲染, 而不是依靠于 v-html 或者是后端生成
Traits
Constants
NAME_ACTION |
|
Properties
Filter | $filter | from HasHeader | |
protected array | $headers | from HasHeader | |
protected bool | $ellipsis | from AsText | |
protected bool | $copyable | 可复制的 | from AsText |
static array | $renderers | renders for grid column. |
|
static array | $defined | Defined columns. |
|
string read-only | $name | 当前列的名称 | |
string read-only | $label | 标签 | |
protected mixed | $original | Original value of column. |
|
string read-only | $relation | 当前关系 | |
protected string | $relationColumn | 关系列 | |
protected Closure[] | $renderCallbacks | ||
protected bool | $sortable | ||
protected bool | $searchable | todo 可搜索的 |
|
protected int | $width | 定义宽度 | |
protected string | $align | 对齐方式 | |
bool read-only | $relationMany | 是否是一对多关系 |
Methods
No description
No description
设置列宽度, 单个按钮 最优宽度 60(图标), 每个按钮增加 45 宽度 Datetime 最优宽度 170
列搜索工具
Set column as searchable.
No description
设置编辑属性
可结构化并返回
No description
Passes through all unknown calls to builtin renders or supported render.
获取类属性
Extend column render.
定义全局列渲染
设置 Relation
If this column is relation column.
If has display callbacks.
调用所有的列渲染回调, 因为 row 可能未自定义的 Query 渲染, 所以返回可能是数组, 这里使用 collect 包裹处理
当前列是否在全局定义中
使用全局列定义
Find a render to display column.
Call Illuminate/Support.
Details
in
HasHeader at line 30
$this
addHeader(string|Renderable|Htmlable $header)
Add contents to column header.
in
HasHeader at line 46
bindFilterQuery(QueryModel $model)
Add a binding based on filter to the model query.
in
HasHeader at line 58
string
renderHeader()
Render Column header.
in
HasHeader at line 73
getHeader()
No description
in
HasHeader at line 82
protected $this
addFilter($type = null, $formal = null)
添加搜索到列 Header
in
AsText at line 87
HiddenOption
asHidden(Closure $cb = null)
隐藏数值
in
AsText at line 112
AsText
usingKv(array $values, string $default = '')
deprecated
deprecated
No description
in
AsText at line 120
EditOption
editAsText(Closure $cb = null, Closure $disableCb = null)
追加编辑模式
in
AsSelect at line 13
SelectOption
editAsSelect(Closure $cb = null, Closure $disableCb = null)
追加编辑模式
in
AsOnOff at line 30
OnOffOption
editAsOnOff(Closure $cb = null, Closure $disableCb = null)
追加编辑模式
in
AsDate at line 17
AsDate
asDate(string $format)
Returns a string formatted according to the given format string.
in
AsDate at line 32
AsDate
asDiffForHumans(null $locale = null)
Return a human readable format time.
in
AsDate at line 59
AsDate
diffForHumans(null $locale = null)
deprecated
deprecated
No description
in
AsDefault at line 10
protected AsDefault
asDefaultDisabled($cb = null, $disableCb = null)
No description
in
AsImage at line 17
AsImage
asImage(string $server = '', int $width = 60, int $height = 60, string $suffix = '')
No description
at line 158
__construct(string $name, string $label = '')
No description
at line 172
Column
width(int $width, bool $fixed = false)
设置列宽度, 单个按钮 最优宽度 60(图标), 每个按钮增加 45 宽度 Datetime 最优宽度 170
at line 188
Column
align(string|int $align)
设置展示位置, 默认 left, 可选 [left,center,right]
at line 198
Column
sortable()
标识列为可排序
at line 210
Column
fixed(string $position = 'right')
标识列为可fix 显示, 默认是右侧, 可以设置为 [left, right]
at line 222
$this
filter(null $builder = null)
列搜索工具
at line 233
Column
searchable()
Set column as searchable.
at line 239
setType($type)
No description
at line 249
void
setEditAttr($attr)
设置编辑属性
at line 254
struct()
可结构化并返回
at line 307
fillVal($row)
No description
at line 345
$this
__call(string $method, array $arguments)
Passes through all unknown calls to builtin renders or supported render.
Allow fluent calls on the Column object.
at line 363
string
__get(string $key)
获取类属性
at line 374
static
extend($name, $render)
Extend column render.
at line 384
static
define(string $name, mixed $definition)
定义全局列渲染
at line 397
Column
setRelation(string $relation, string $field, bool $many = false)
设置 Relation
at line 410
protected bool
isRelation()
If this column is relation column.
at line 420
protected bool
hasRenderCallbacks()
If has display callbacks.
at line 431
protected mixed
callDisplayCallbacks(mixed $value, $row)
调用所有的列渲染回调, 因为 row 可能未自定义的 Query 渲染, 所以返回可能是数组, 这里使用 collect 包裹处理
at line 456
protected bool
isDefinedColumn()
当前列是否在全局定义中
at line 465
protected
useDefinedColumn()
使用全局列定义
at line 499
protected Column
resolveRender(string $method, array $arguments)
Find a render to display column.
at line 515
protected Column
callSupportRender(string $method, array $arguments)
Call Illuminate/Support.