PHP Класс kartik\grid\ExpandRowColumn

To add an ExpandRowColumn to the gridview, add it to the [[GridView::columns|columns]] configuration as follows: php 'columns' => [ ... [ 'class' => ExpandRowColumn::className(), you may configure additional properties here ], ]
С версии: 1.0
Автор: Kartik Visweswaran ([email protected])
Наследование: extends DataColumn
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$allowBatchToggle allow batch expansion or batch collapse of all rows by clicking the header indicator. Defaults to true.
$collapseAllTitle title to display on hover of collapse indicator at header.
$collapseIcon icon for the collapse indicator. If this is not set, it will derive values automatically using the following rules: - If GridView bootstrap property is set to true, it will default to [[GridView::ICON_COLLAPSE]] or - If GridView bootstrap property is set to false, then it will default to -.
$collapseTitle title to display on hover of collapse indicator for each row.
$defaultHeaderState default state of the header. The following values can be set: - [[GridView::ROW_COLLAPSED]]: Will set all rows to collapsed and display the [[expandIcon]]. - [[GridView::ROW_EXPANDED]]: Will set all rows to expanded and display the [[collapseIcon]].
$detail the detail content (html markup) to be displayed in the expanded row. Either [[detail]] or [[detailUrl]] must be entered. This can be a normal html markup or an anonymous function that returns the markup. The anonymous function should have the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
$detailAnimationDuration the animation duration to slide up/down the detail row.
$detailOptions the HTML attributes for the expanded table row. This can be an array or an anonymous function of the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
$detailRowCssClass the CSS class for the detail content table row.
$detailUrl the url/action that would render the detail content via ajax. Either detail OR detailUrl must be entered. The ajax response must return the content/markup to render. The extension automatically passes the following data parameters to the server URL as POST data: - expandRowKey the key associated with the data model - expandRowIndex the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
$disabled whether the expand icon indicator is disabled. Defaults to false. If set to true, one cannot collapse or expand the sections. This can be setup as an anonymous function having the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
$enableCache whether to enable caching of expanded row content while expanding the row using ajax triggered action (applicable when detailUrl is set). Defaults to true.
$enableRowClick whether to toggle the expansion/collapse by clicking on the table row. To disable row click for specific elements within the row you can add the CSS class kv-disable-click to tags/elements to disable the toggle functionality.
$expandAllTitle title to display on hover of expand indicator at header.
$expandIcon icon for the expand indicator. If this is not set, it will derive values automatically using the following rules: - If GridView bootstrap property is set to true, it will default to [[GridView::ICON_EXPAND]] or - If GridView bootstrap property is set to false, then it will default to +.
$expandOneOnly whether to allow only one row to be expanded at a time and auto collapse other expanded rows whenever a row is expanded. Defaults to false.
$expandTitle title to display on hover of expand indicator for each row.
$extraData additional data that will be passed to the ajax load function as key value pairs
$hAlign
$hiddenFromExport
$mergeHeader
$onDetailLoaded the javascript callback to execute after loading the content via ajax. Only applicable when detailUrl is provided.
$rowClickExcludedTags list of tags in the row on which row click will be disabled.
$value the value of this attribute will identify the state of the current row. The following values are supported: - [[GridView::ROW_EXPANDED]] or 0: the row will be expanded by default and will display the collapse indicator. - [[GridView::ROW_COLLAPSED]] or 1: the row will be collapsed by default and will display the expand indicator. - [[GridView::ROW_NONE]] or -1: no indicator will be displayed for the row. If this is not set, $model[$attribute] will be used to obtain the value. If this value is evaluated as empty or null, it is treated as [[GridView::ROW_NONE]]. This can also be an anonymous function that returns one of the values above. The anonymous function should have the signature function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
$width

Защищенные свойства (Protected)

Свойство Тип Описание
$_hashVar hashed javascript variable to store grid expand row options

Открытые методы

Метод Описание
getDataCellValue ( $model, $key, $index )
init ( )
renderDataCell ( $model, $key, $index )

Защищенные методы

Метод Описание
getIcon ( string $type ) : string Get icon indicator
parseData ( string | Closur\Closure $data, Model $model, string | object $key, integer $index, ExpandRowColumn $column ) : string Parses data for Closure and returns accordingly
renderHeaderCellContent ( )
setProp ( string $prop, string $val ) Sets property for the object instance if not set

Описание методов

getDataCellValue() публичный Метод

public getDataCellValue ( $model, $key, $index )

getIcon() защищенный Метод

Get icon indicator
protected getIcon ( string $type ) : string
$type string one of `expand` or `collapse`
Результат string the icon indicator markup

init() публичный Метод

public init ( )

parseData() защищенный статический Метод

Parses data for Closure and returns accordingly
protected static parseData ( string | Closur\Closure $data, Model $model, string | object $key, integer $index, ExpandRowColumn $column ) : string
$data string | Closur\Closure the data to parse.
$model yii\base\Model the data model.
$key string | object the key associated with the data model.
$index integer the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
$column ExpandRowColumn the column object instance.
Результат string

renderDataCell() публичный Метод

public renderDataCell ( $model, $key, $index )

renderHeaderCellContent() защищенный Метод

protected renderHeaderCellContent ( )

setProp() защищенный Метод

Sets property for the object instance if not set
protected setProp ( string $prop, string $val )
$prop string the property name
$val string the property value

Описание свойств

$_hashVar защищенное свойство

hashed javascript variable to store grid expand row options
protected $_hashVar

$allowBatchToggle публичное свойство

allow batch expansion or batch collapse of all rows by clicking the header indicator. Defaults to true.
public $allowBatchToggle

$collapseAllTitle публичное свойство

title to display on hover of collapse indicator at header.
public $collapseAllTitle

$collapseIcon публичное свойство

icon for the collapse indicator. If this is not set, it will derive values automatically using the following rules: - If GridView bootstrap property is set to true, it will default to [[GridView::ICON_COLLAPSE]] or - If GridView bootstrap property is set to false, then it will default to -.
public $collapseIcon

$collapseTitle публичное свойство

title to display on hover of collapse indicator for each row.
public $collapseTitle

$defaultHeaderState публичное свойство

default state of the header. The following values can be set: - [[GridView::ROW_COLLAPSED]]: Will set all rows to collapsed and display the [[expandIcon]]. - [[GridView::ROW_EXPANDED]]: Will set all rows to expanded and display the [[collapseIcon]].
public $defaultHeaderState

$detail публичное свойство

the detail content (html markup) to be displayed in the expanded row. Either [[detail]] or [[detailUrl]] must be entered. This can be a normal html markup or an anonymous function that returns the markup. The anonymous function should have the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
public $detail

$detailAnimationDuration публичное свойство

the animation duration to slide up/down the detail row.
См. также: http://api.jquery.com/slidedown/
public $detailAnimationDuration

$detailOptions публичное свойство

the HTML attributes for the expanded table row. This can be an array or an anonymous function of the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
public $detailOptions

$detailRowCssClass публичное свойство

the CSS class for the detail content table row.
public $detailRowCssClass

$detailUrl публичное свойство

the url/action that would render the detail content via ajax. Either detail OR detailUrl must be entered. The ajax response must return the content/markup to render. The extension automatically passes the following data parameters to the server URL as POST data: - expandRowKey the key associated with the data model - expandRowIndex the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
См. также: http://api.jquery.com/jquery.load/
public $detailUrl

$disabled публичное свойство

whether the expand icon indicator is disabled. Defaults to false. If set to true, one cannot collapse or expand the sections. This can be setup as an anonymous function having the signature: function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
public $disabled

$enableCache публичное свойство

whether to enable caching of expanded row content while expanding the row using ajax triggered action (applicable when detailUrl is set). Defaults to true.
public $enableCache

$enableRowClick публичное свойство

whether to toggle the expansion/collapse by clicking on the table row. To disable row click for specific elements within the row you can add the CSS class kv-disable-click to tags/elements to disable the toggle functionality.
public $enableRowClick

$expandAllTitle публичное свойство

title to display on hover of expand indicator at header.
public $expandAllTitle

$expandIcon публичное свойство

icon for the expand indicator. If this is not set, it will derive values automatically using the following rules: - If GridView bootstrap property is set to true, it will default to [[GridView::ICON_EXPAND]] or - If GridView bootstrap property is set to false, then it will default to +.
public $expandIcon

$expandOneOnly публичное свойство

whether to allow only one row to be expanded at a time and auto collapse other expanded rows whenever a row is expanded. Defaults to false.
public $expandOneOnly

$expandTitle публичное свойство

title to display on hover of expand indicator for each row.
public $expandTitle

$extraData публичное свойство

additional data that will be passed to the ajax load function as key value pairs
public $extraData

$hAlign публичное свойство

public $hAlign

$hiddenFromExport публичное свойство

public $hiddenFromExport

$mergeHeader публичное свойство

public $mergeHeader

$onDetailLoaded публичное свойство

the javascript callback to execute after loading the content via ajax. Only applicable when detailUrl is provided.
public $onDetailLoaded

$rowClickExcludedTags публичное свойство

list of tags in the row on which row click will be disabled.
public $rowClickExcludedTags

$value публичное свойство

the value of this attribute will identify the state of the current row. The following values are supported: - [[GridView::ROW_EXPANDED]] or 0: the row will be expanded by default and will display the collapse indicator. - [[GridView::ROW_COLLAPSED]] or 1: the row will be collapsed by default and will display the expand indicator. - [[GridView::ROW_NONE]] or -1: no indicator will be displayed for the row. If this is not set, $model[$attribute] will be used to obtain the value. If this value is evaluated as empty or null, it is treated as [[GridView::ROW_NONE]]. This can also be an anonymous function that returns one of the values above. The anonymous function should have the signature function ($model, $key, $index, $column), where: - $model: _\yii\base\Model_, is the data model. - $key: _string|object_, is the primary key value associated with the data model. - $index: _integer_, is the zero-based index of the data model among the model array returned by [[dataProvider]]. - $column: _ExpandRowColumn_, is the column object instance.
public $value

$width публичное свойство

public $width