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
파일 보기 프로젝트 열기: kartik-v/yii2-grid

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$_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