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 88
HiddenOption
asHidden(Closure $cb = null)
隐藏数值
in
AsText at line 113
AsText
usingKv(array $values, string $default = '')
deprecated
deprecated
No description
in
AsText at line 123
TextQueryOption
editAsText(Closure $cb = null, Closure $disableCb = null)
deprecated
deprecated
追加编辑模式
in
AsText at line 131
TextOption
asModifyText(Closure $disableCb = null)
行内编辑
in
AsText at line 144
TextQueryOption
asInlineSaveText(Closure $cb = null, Closure $disableCb = null)
行内保存
in
AsSelect at line 14
SelectQueryOption
asInlineSaveSelect(Closure $cb = null, Closure $disableCb = null)
追加编辑模式
in
AsSelect at line 27
SelectOption
asModifySelect(Closure $disableCb = null)
追加编辑模式
in
AsSelect at line 45
SelectQueryOption
editAsSelect(Closure $cb = null, Closure $disableCb = null)
deprecated
deprecated
No description
in
AsOnOff at line 31
OnOffOption
asModifyOnOff(Closure $disableCb = null)
编辑模式(非行内请求)
in
AsOnOff at line 44
OnOffQueryOption
asInlineSaveOnOff(Closure $cb = null, Closure $disableCb = null)
追加编辑模式
in
AsOnOff at line 59
OnOffQueryOption
editAsOnOff(Closure $cb = null, Closure $disableCb = null)
deprecated
deprecated
追加编辑模式
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
WithDefault at line 10
protected WithDefault
withInlineSaveDisabled($cb = null, $disableCb = null)
No description
in
WithDefault at line 34
protected WithDefault
withModifyDisabled($disableCb = null)
是否禁用当前数据
in
AsImage at line 17
AsImage
asImage(string $server = '', int $width = 60, int $height = 60, string $suffix = '')
No description
in
AsAction at line 23
asTableAction($disabled = [])
No description
at line 158
__construct(string $name, string $label = '')
No description
at line 173
Column
width(int $width, bool $fixed = false)
设置列宽度, 单个按钮 最优宽度 60(图标), 每个按钮增加 45 宽度 Datetime 最优宽度 170
at line 189
Column
align(string|int $align)
设置展示位置, 默认 left, 可选 [left,center,right]
at line 199
Column
sortable()
标识列为可排序
at line 211
Column
fixed(string $position = 'right')
标识列为可fix 显示, 默认是右侧, 可以设置为 [left, right]
at line 223
$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 306
fillVal($row)
No description
at line 344
$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 362
string
__get(string $key)
获取类属性
at line 373
static
extend($name, $render)
Extend column render.
at line 383
static
define(string $name, mixed $definition)
定义全局列渲染
at line 396
Column
setRelation(string $relation, string $field, bool $many = false)
设置 Relation
at line 409
protected bool
isRelation()
If this column is relation column.
at line 419
protected bool
hasRenderCallbacks()
If has display callbacks.
at line 430
protected mixed
callDisplayCallbacks(mixed $value, $row)
调用所有的列渲染回调, 因为 row 可能未自定义的 Query 渲染, 所以返回可能是数组, 这里使用 collect 包裹处理
at line 455
protected bool
isDefinedColumn()
当前列是否在全局定义中
at line 463
protected
useDefinedColumn()
使用全局列定义
at line 494
protected Column
resolveRender(string $method, array $arguments)
Find a render to display column.
at line 510
protected Column
callSupportRender(string $method, array $arguments)
Call Illuminate/Support.