| Methods |
public
|
__construct(array $defaults = [])
|
#
|
public
|
addPopup(Popup $popup = null, string $icon = 'table-filter-off'): mixed
Add popup to header.
Use ColumnName for better popup positioning.
Add popup to header.
Use ColumnName for better popup positioning.
Parameters
| $icon |
CSS class for filter icon
|
|
#
|
public
|
setHeaderPopup(string $class, string $id): void
Setup popup header action.
Setup popup header action.
Parameters
| $class |
the CSS class for filter icon
|
|
#
|
public
|
setHeaderPopupIcon(string $icon): void
Set header popup icon.
|
#
|
public
|
addDropdown(
array $items,
Closure(string, string): (JsExpressionable|View|string|void) $fx,
string $icon = 'caret square down',
string|null $menuId = null,
): void
Add a dropdown header menu.
Add a dropdown header menu.
Parameters
|
#
|
public
|
setHeaderDropdown(
array<int, array> $items,
string $icon = 'caret square down',
string $menuId = null,
): JsHeaderDropdownCallback
Setup dropdown header action.
This method return a callback where you can detect
menu item change via $cb->onMenuItem(…
Setup dropdown header action.
This method return a callback where you can detect
menu item change via $cb->onMenuItem($item) function.
|
#
|
public
|
addClass(string $class, string $position = 'body'): $this
Adds a new class to the cells of this column. The optional second argument may be "head",
"body" or "foot". If position…
Adds a new class to the cells of this column. The optional second argument may be "head",
"body" or "foot". If position is not defined, then class will be applied on all cells.
|
#
|
public
|
setAttr(string $attr, string $value, string $position = 'body'): $this
Adds a new attribute to the cells of this column. The optional second argument may be "head",
"body" or "foot". If…
Adds a new attribute to the cells of this column. The optional second argument may be "head",
"body" or "foot". If position is not defined, then attribute will be applied on all cells.
You can also use the "{$name}" value if you wish to specific row value:
$table->column['name']->setAttr('data', '{$id}');
|
#
|
public
|
getTagAttributes(string $position, array $attr = []): array
|
#
|
public
|
getTag(
string $position,
string|array<int, array{0: string, 1?: array<0|string, string|bool>, 2?: (string|array|null)}|string>|null $value,
array<string, string|bool|array> $attr = [],
): string
Returns a suitable cell tag with the supplied value. Applies modifiers
added through addClass and setAttr.
Returns a suitable cell tag with the supplied value. Applies modifiers
added through addClass and setAttr.
Parameters
| $position |
'head', 'body' or 'tail'
|
| $value |
either HTML or array defining HTML structure, see App::getTag help
|
| $attr |
extra attributes to apply on the tag
|
Overriden by
|
#
|
public
|
getHeaderCellHtml(Field $field = null, mixed $value = null): string
Provided with a field definition (from a model) will return a header
cell, fully formatted to be included in a Table. (…
Provided with a field definition (from a model) will return a header
cell, fully formatted to be included in a Table. ( ).
Overriden by
| |
#
|
public
|
getTotalsCellHtml(Field $field, mixed $value): string
Return HTML for a total value of a specific field.
Return HTML for a total value of a specific field.
|
#
|
public
|
getDataCellHtml(Field $field = null, array $attr = []): string
Provided with a field definition will return a string containing a "Template"
that would produce <td> cell when…
Provided with a field definition will return a string containing a "Template"
that would produce cell when rendered. Example output:.
| {$name} |
The must correspond to the name of the field, although you can also use multiple tags. The tag
will also be formatted before inserting, see UI Persistence formatting in the documentation.
This method will be executed only once per table rendering, if you need to format data manually,
you should use $this->table->onHook('beforeRow' or 'afterRow', ...);
Overriden by
|
#
|
public
|
getDataCellTemplate(Field $field = null): string
Provided with a field definition will return a string containing a "Template"
that would produce CONTENTS OF <td> cell…
Provided with a field definition will return a string containing a "Template"
that would produce CONTENTS OF cell when rendered. Example output:.
{$name}
The tag that corresponds to the name of the field (e.g. {$name}) may be substituted
by another template returned by getDataCellTemplate when multiple formatters are
applied to the same column. The first one to be applied is executed first, then
a subsequent ones are executed.
Overriden by
|
#
|
|
public
|
getHtmlTags(Model $row, ?Field $field): array<string, string>
Return associative array of tags to be filled with pre-rendered HTML on
a column-basis. Will not be invoked if HTML…
Return associative array of tags to be filled with pre-rendered HTML on
a column-basis. Will not be invoked if HTML output is turned off for the table.
Overriden by
|
#
|
public
|
getOwner(): Table
|
#
|
| Properties |
public
|
Table
|
$table
Link back to the table, where column is used.
Link back to the table, where column is used.
|
#
|
public
|
array
|
$attr = []
Contains any custom attributes that may be applied on head, body or foot.
Contains any custom attributes that may be applied on head, body or foot.
|
#
|
public
|
string|null
|
$caption
If set, will override column header value.
If set, will override column header value.
|
#
|
public
|
bool
|
$sortable = true
Is column sortable?
|
#
|
public
|
string|null
|
$columnData
The data-column attribute value for Table th tag.
The data-column attribute value for Table th tag.
|
#
|
public
|
bool
|
$hasHeaderAction = false
Include header action tag in rendering or not.
Include header action tag in rendering or not.
|
#
|
public
|
array|null
|
$headerActionTag
The tag value required for getTag when using an header action.
The tag value required for getTag when using an header action.
|
#
|