PHP Class Ublaboo\DataGrid\Column\Column

Inheritance: extends Ublaboo\DataGrid\Object
Afficher le fichier Open project: ublaboo/datagrid Class Usage Examples

Protected Properties

Свойство Type Description
$align string
$default_hide boolean
$editable_callback callable
$editable_element array
$el_cache array Cached html elements
$header_escaping boolean
$renderer Renderer | null
$replacements array
$sort array
$sortable boolean | string
$sortable_callback null | callable
$sortable_reset_pagination boolean
$template string
$template_escaping boolean
$template_variables array

Méthodes publiques

Méthode Description
addAttributes ( array $attrs ) : static Set attributes for both th and td element
applyReplacements ( Row $row ) : array Apply replacements
getAlign ( ) : string Get column alignment
getColumn ( ) : string
getColumnName ( ) : string Get column name
getColumnValue ( Row $row ) : mixed Get column value of row item
getDefaultHide ( )
getEditableCallback ( ) : callable Return callback that is used after inline editing
getEditableInputType ( ) : array [getEditableInputType description]
getElementPrototype ( string $tag, string $key = NULL, Row $row = NULL ) : Nette\Utils\Html Get th/td column element
getName ( ) : string
getRenderer ( ) : Renderer | null Return custom renderer callback
getSortNext ( ) : array What sorting will be applied after next click?
getSortableCallback ( ) : callable | null Get custom ORDER BY clause
getSortingColumn ( ) : string Get column to sort by
getTemplate ( ) : string Get column template path
getTemplateVariables ( ) : array Column can have variables that will be passed to custom template scope
hasAlign ( ) : boolean Has column some alignment?
hasReplacements ( ) : boolean Tell whether columns has replacements
hasSortNext ( ) : boolean
hasTemplate ( ) : boolean Tell whether column has its owntemplate
isEditable ( ) : boolean Is column editable?
isHeaderEscaped ( )
isSortAsc ( ) : boolean Is sorting ascending?
isSortable ( ) : boolean Tell whether column is sortable
isSortedBy ( ) : boolean Tell whether data source is sorted by this collumn
isTemplateEscaped ( )
render ( Row $row ) : mixed Render row item into template
setAlign ( string $align ) Set column alignment
setDefaultHide ( boolean $default_hide = TRUE ) : static
setEditableCallback ( callable $editable_callback ) Set callback that will be called after inline editing
setEditableInputType ( string $el_type, array $attrs = [] ) : static Element is by default textarea, user can change that
setEditableInputTypeSelect ( array $options = [] ) : static Change small inline edit input type to select
setFitContent ( boolean $fit_content = TRUE ) Set column content fit
setHeaderEscaping ( boolean $header_escaping = FALSE ) Should be column header escaped in latte?
setRenderer ( callable $renderer, $condition_callback = NULL ) Set renderer callback and (it may be optional - the condition callback will decide)
setRendererOnCondition ( callable $renderer, $condition_callback ) Set renderer callback just if condition is truthy
setReplacement ( array $replacements ) : Column Set column replacements
setSort ( array $sort ) Tell column his sorting options
setSortable ( boolean | string $sortable = TRUE ) Set column sortable or not
setSortableCallback ( callable $sortable_callback ) : static Set custom ORDER BY clause
setSortableResetPagination ( boolean $sortable_reset_pagination = TRUE ) : static Shoud be the pagination reseted after sorting?
setTemplate ( string $template, array $template_variables = [] ) Column may have its own template
setTemplateEscaping ( boolean $template_escaping = TRUE ) Should be column values escaped in latte?
sortableResetPagination ( ) : boolean Do reset pagination after sorting?
useRenderer ( Row $row ) : mixed Try to render item with custom renderer

Méthodes protégées

Méthode Description
getItemParams ( Row $row, array $params_list ) : array Get row item params (E.g. action may be called id => $item->id, name => $item->name, .

Method Details

addAttributes() public méthode

Set attributes for both th and td element
public addAttributes ( array $attrs ) : static
$attrs array
Résultat static

applyReplacements() public méthode

Apply replacements
public applyReplacements ( Row $row ) : array
$row Ublaboo\DataGrid\Row
Résultat array

getAlign() public méthode

Get column alignment
public getAlign ( ) : string
Résultat string

getColumn() public méthode

public getColumn ( ) : string
Résultat string

getColumnName() public méthode

Get column name
public getColumnName ( ) : string
Résultat string

getColumnValue() public méthode

Get column value of row item
public getColumnValue ( Row $row ) : mixed
$row Ublaboo\DataGrid\Row
Résultat mixed

getDefaultHide() public méthode

public getDefaultHide ( )

getEditableCallback() public méthode

Return callback that is used after inline editing
public getEditableCallback ( ) : callable
Résultat callable

getEditableInputType() public méthode

[getEditableInputType description]
public getEditableInputType ( ) : array
Résultat array

getElementPrototype() public méthode

Get th/td column element
public getElementPrototype ( string $tag, string $key = NULL, Row $row = NULL ) : Nette\Utils\Html
$tag string th|td
$key string
$row Ublaboo\DataGrid\Row
Résultat Nette\Utils\Html

getItemParams() protected méthode

..)
protected getItemParams ( Row $row, array $params_list ) : array
$row Ublaboo\DataGrid\Row
$params_list array
Résultat array

getName() public méthode

public getName ( ) : string
Résultat string

getRenderer() public méthode

Return custom renderer callback
public getRenderer ( ) : Renderer | null
Résultat Renderer | null

getSortNext() public méthode

What sorting will be applied after next click?
public getSortNext ( ) : array
Résultat array

getSortableCallback() public méthode

Get custom ORDER BY clause
public getSortableCallback ( ) : callable | null
Résultat callable | null

getSortingColumn() public méthode

Get column to sort by
public getSortingColumn ( ) : string
Résultat string

getTemplate() public méthode

Get column template path
public getTemplate ( ) : string
Résultat string

getTemplateVariables() public méthode

Column can have variables that will be passed to custom template scope
public getTemplateVariables ( ) : array
Résultat array

hasAlign() public méthode

Has column some alignment?
public hasAlign ( ) : boolean
Résultat boolean [description]

hasReplacements() public méthode

Tell whether columns has replacements
public hasReplacements ( ) : boolean
Résultat boolean

hasSortNext() public méthode

public hasSortNext ( ) : boolean
Résultat boolean

hasTemplate() public méthode

Tell whether column has its owntemplate
public hasTemplate ( ) : boolean
Résultat boolean

isEditable() public méthode

Is column editable?
public isEditable ( ) : boolean
Résultat boolean

isHeaderEscaped() public méthode

public isHeaderEscaped ( )

isSortAsc() public méthode

Is sorting ascending?
public isSortAsc ( ) : boolean
Résultat boolean

isSortable() public méthode

Tell whether column is sortable
public isSortable ( ) : boolean
Résultat boolean

isSortedBy() public méthode

Tell whether data source is sorted by this collumn
public isSortedBy ( ) : boolean
Résultat boolean

isTemplateEscaped() public méthode

public isTemplateEscaped ( )

render() public méthode

Render row item into template
public render ( Row $row ) : mixed
$row Ublaboo\DataGrid\Row
Résultat mixed

setAlign() public méthode

Set column alignment
public setAlign ( string $align )
$align string

setDefaultHide() public méthode

public setDefaultHide ( boolean $default_hide = TRUE ) : static
$default_hide boolean
Résultat static

setEditableCallback() public méthode

Set callback that will be called after inline editing
public setEditableCallback ( callable $editable_callback )
$editable_callback callable

setEditableInputType() public méthode

Element is by default textarea, user can change that
public setEditableInputType ( string $el_type, array $attrs = [] ) : static
$el_type string
$attrs array
Résultat static

setEditableInputTypeSelect() public méthode

Change small inline edit input type to select
public setEditableInputTypeSelect ( array $options = [] ) : static
$options array
Résultat static

setFitContent() public méthode

Set column content fit
public setFitContent ( boolean $fit_content = TRUE )
$fit_content boolean

setHeaderEscaping() public méthode

Should be column header escaped in latte?
public setHeaderEscaping ( boolean $header_escaping = FALSE )
$header_escaping boolean

setRenderer() public méthode

Set renderer callback and (it may be optional - the condition callback will decide)
public setRenderer ( callable $renderer, $condition_callback = NULL )
$renderer callable

setRendererOnCondition() public méthode

Set renderer callback just if condition is truthy
public setRendererOnCondition ( callable $renderer, $condition_callback )
$renderer callable

setReplacement() public méthode

Set column replacements
public setReplacement ( array $replacements ) : Column
$replacements array
Résultat Column

setSort() public méthode

Tell column his sorting options
public setSort ( array $sort )
$sort array

setSortable() public méthode

Set column sortable or not
public setSortable ( boolean | string $sortable = TRUE )
$sortable boolean | string

setSortableCallback() public méthode

Set custom ORDER BY clause
public setSortableCallback ( callable $sortable_callback ) : static
$sortable_callback callable
Résultat static

setSortableResetPagination() public méthode

Shoud be the pagination reseted after sorting?
public setSortableResetPagination ( boolean $sortable_reset_pagination = TRUE ) : static
$sortable_reset_pagination boolean
Résultat static

setTemplate() public méthode

Column may have its own template
public setTemplate ( string $template, array $template_variables = [] )
$template string
$template_variables array

setTemplateEscaping() public méthode

Should be column values escaped in latte?
public setTemplateEscaping ( boolean $template_escaping = TRUE )
$template_escaping boolean

sortableResetPagination() public méthode

Do reset pagination after sorting?
public sortableResetPagination ( ) : boolean
Résultat boolean

useRenderer() public méthode

Try to render item with custom renderer
public useRenderer ( Row $row ) : mixed
$row Ublaboo\DataGrid\Row
Résultat mixed

Property Details

$align protected_oe property

protected string $align
Résultat string

$default_hide protected_oe property

protected bool $default_hide
Résultat boolean

$editable_callback protected_oe property

protected callable $editable_callback
Résultat callable

$editable_element protected_oe property

protected array $editable_element
Résultat array

$el_cache protected_oe property

Cached html elements
protected array $el_cache
Résultat array

$header_escaping protected_oe property

protected bool $header_escaping
Résultat boolean

$renderer protected_oe property

protected Renderer,Ublaboo\DataGrid\Column|NULL $renderer
Résultat Renderer | null

$replacements protected_oe property

protected array $replacements
Résultat array

$sort protected_oe property

protected array $sort
Résultat array

$sortable protected_oe property

protected bool|string $sortable
Résultat boolean | string

$sortable_callback protected_oe property

protected null|callable $sortable_callback
Résultat null | callable

$sortable_reset_pagination protected_oe property

protected bool $sortable_reset_pagination
Résultat boolean

$template protected_oe property

protected string $template
Résultat string

$template_escaping protected_oe property

protected bool $template_escaping
Résultat boolean

$template_variables protected_oe property

protected array $template_variables
Résultat array