Class CCheckBoxColumn
CCheckBoxColumn represents a grid view column of checkboxes.
CCheckBoxColumn supports no checking (read-only), single check and multiple
checking. The mode is determined according to CCheckBoxColumn::$selectableRows
. When in
multiple checking mode, the header cell will display an additional checkbox,
clicking on which will check or uncheck all of the checkboxes in the data cells.
The header cell can be customized by CCheckBoxColumn::$headerTemplate
.
Additionally selecting a checkbox can select a grid view row (depending on
CGridView::$selectableRows
value) if CCheckBoxColumn::$selectableRows
is null
(default).
By default, the checkboxes rendered in data cells will have the values that
are the same as the key values of the data model. One may change this by setting
either CCheckBoxColumn::$name
or CCheckBoxColumn::$value
.
- CComponent
- CGridColumn
- CCheckBoxColumn
Direct known subclasses
X2CheckBoxColumnCopyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.1
Located at x2engine/framework/zii/widgets/grid/CCheckBoxColumn.php
public
|
|
public
string
|
#
getHeaderCellContent( )
Returns the header cell content. This method will render a checkbox in the
header when |
public
string
|
#
getDataCellContent( integer $row )
Returns the data cell content. This method renders a checkbox in the data cell. |
__construct(),
getFilterCellContent(),
getFooterCellContent(),
getHasFooter(),
renderDataCell(),
renderFilterCell(),
renderFooterCell(),
renderHeaderCell()
|
public
string
|
$name |
|
#
the attribute name of the data model. The corresponding attribute value will
be rendered in each data cell as the checkbox value. Note that if |
public
string
|
$value |
|
#
a PHP expression that will be evaluated for every data cell and whose result
will be rendered in each data cell as the checkbox value. In this expression,
you can use the following variables:
CComponent::evaluateExpression() .
A PHP expression can be any PHP code that has a value. To learn more about what an expression is, please refer to the php manual. |
public
string
|
$checked |
|
#
a PHP expression that will be evaluated for every data cell and whose result
will determine if checkbox for each data cell is checked. In this expression,
you can use the following variables:
CComponent::evaluateExpression() .
A PHP expression can be any PHP code that has a value. To learn more about what an expression is, please refer to the php manual. |
public
string
|
$disabled |
|
#
a PHP expression that will be evaluated for every data cell and whose result
will determine if checkbox for each data cell is disabled. In this expression,
you can use the following variables:
CComponent::evaluateExpression() .
A PHP expression can be any PHP code that has a value. To learn more about what an expression is, please refer to the php manual. Note that expression result will overwrite value set with
|
public
array
|
$htmlOptions | array('class'=>'checkbox-column') |
#
the HTML options for the data cell tags. |
public
array
|
$headerHtmlOptions | array('class'=>'checkbox-column') |
#
the HTML options for the header cell tag. |
public
array
|
$footerHtmlOptions | array('class'=>'checkbox-column') |
#
the HTML options for the footer cell tag. |
public
array
|
$checkBoxHtmlOptions | array() |
#
the HTML options for the checkboxes. |
public
integer
|
$selectableRows | null |
#
the number of rows that can be checked. Possible values:
<span
class="php-var">$</span>(gridID).yiiGridView(<span
class="php-quote">'getChecked'</span>, columnID) to retrieve the
key values of the checked rows.
|
public
string
|
$headerTemplate | '{item}' |
#
the template to be used to control the layout of the header cell. The token
"{item}" is recognized and it will be replaced with a "check all" checkbox. By
default if in multiple checking mode, the header cell will display an additional
checkbox, clicking on which will check or uncheck all of the checkboxes in the
data cells. See |
$cssClassExpression,
$filterHtmlOptions,
$footer,
$grid,
$header,
$id,
$visible
|
$filterCellContent,
$footerCellContent,
$hasFooter,
$headerCellContent
|