Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CButtonColumn
  • CCheckBoxColumn
  • CDataColumn
  • CGridColumn
  • CGridView
  • CLinkColumn
  • X2CheckBoxColumn
  • X2DataColumnGeneric
  • Overview
  • Package
  • Class
  • Tree

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
Extended by CGridColumn
Extended by CCheckBoxColumn

Direct known subclasses

X2CheckBoxColumn
Package: zii\widgets\grid
Copyright: 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
Methods summary
public
# init( )

Initializes the column. This method registers necessary client script for the checkbox column.

Initializes the column. This method registers necessary client script for the checkbox column.

Overrides

CGridColumn::init()
public string
# getHeaderCellContent( )

Returns the header cell content. This method will render a checkbox in the header when CCheckBoxColumn::$selectableRows is greater than 1 or in case CCheckBoxColumn::$selectableRows is null when CGridView::$selectableRows is greater than 1.

Returns the header cell content. This method will render a checkbox in the header when CCheckBoxColumn::$selectableRows is greater than 1 or in case CCheckBoxColumn::$selectableRows is null when CGridView::$selectableRows is greater than 1.

Returns

string
the header cell content.

Since

1.1.16

Overrides

CGridColumn::getHeaderCellContent()
public string
# getDataCellContent( integer $row )

Returns the data cell content. This method renders a checkbox in the data cell.

Returns the data cell content. This method renders a checkbox in the data cell.

Parameters

$row
integer
$row the row number (zero-based)

Returns

string
the data cell content.

Since

1.1.16

Overrides

CGridColumn::getDataCellContent()
Methods inherited from CGridColumn
__construct(), getFilterCellContent(), getFooterCellContent(), getHasFooter(), renderDataCell(), renderFilterCell(), renderFooterCell(), renderHeaderCell()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
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 CCheckBoxColumn::$value is specified, this property will be ignored.

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 CCheckBoxColumn::$value is specified, this property will be ignored.

See

CCheckBoxColumn::$value
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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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.

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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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.

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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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.

Since

1.1.4
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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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 checkBoxHtmlOptions[<span class="php-quote">'disabled'</span>].

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:
  • <span class="php-var">$row</span> the row number (zero-based)
  • <span class="php-var">$data</span> the data model for the row
  • <span class="php-var">$this</span> the column object
The PHP expression will be evaluated using 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 checkBoxHtmlOptions[<span class="php-quote">'disabled'</span>].

Since

1.1.13
public array $htmlOptions array('class'=>'checkbox-column')
#

the HTML options for the data cell tags.

the HTML options for the data cell tags.

public array $headerHtmlOptions array('class'=>'checkbox-column')
#

the HTML options for the header cell tag.

the HTML options for the header cell tag.

public array $footerHtmlOptions array('class'=>'checkbox-column')
#

the HTML options for the footer cell tag.

the HTML options for the footer cell tag.

public array $checkBoxHtmlOptions array()
#

the HTML options for the checkboxes.

the HTML options for the checkboxes.

public integer $selectableRows null
#
the number of rows that can be checked. Possible values:
  • 0 - the state of the checkbox cannot be changed (read-only mode)
  • 1 - only one row can be checked. Checking a checkbox has nothing to do with selecting the row
  • 2 or more - multiple checkboxes can be checked. Checking a checkbox has nothing to do with selecting the row
  • null - CGridView::$selectableRows is used to control how many checkboxes can be checked. Checking a checkbox will also select the row.
You may also call the JavaScript function <span class="php-var">$</span>(gridID).yiiGridView(<span class="php-quote">'getChecked'</span>, columnID) to retrieve the key values of the checked rows.
the number of rows that can be checked. Possible values:
  • 0 - the state of the checkbox cannot be changed (read-only mode)
  • 1 - only one row can be checked. Checking a checkbox has nothing to do with selecting the row
  • 2 or more - multiple checkboxes can be checked. Checking a checkbox has nothing to do with selecting the row
  • null - CGridView::$selectableRows is used to control how many checkboxes can be checked. Checking a checkbox will also select the row.
You may also call the JavaScript function <span class="php-var">$</span>(gridID).yiiGridView(<span class="php-quote">'getChecked'</span>, columnID) to retrieve the key values of the checked rows.

Since

1.1.6
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 CCheckBoxColumn::$selectableRows for more details.

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 CCheckBoxColumn::$selectableRows for more details.

Since

1.1.11
Properties inherited from CGridColumn
$cssClassExpression, $filterHtmlOptions, $footer, $grid, $header, $id, $visible
Magic properties inherited from CGridColumn
$filterCellContent, $footerCellContent, $hasFooter, $headerCellContent
API documentation generated by ApiGen 2.8.0