Class CDataColumn
CDataColumn represents a grid view column that is associated with a data attribute or PHP expression.
Either CDataColumn::$name
or CDataColumn::$value
should be specified. The former
specifies a data attribute name, while the latter a PHP expression whose value
should be rendered instead.
The property CDataColumn::$sortable
determines whether the grid view can be sorted
according to this column. Note that the CDataColumn::$name
should always be set if the
column needs to be sortable. The CDataColumn::$name
value will be used by CSort
to render a clickable link in the header cell to trigger the sorting.
- CComponent
- CGridColumn
- CDataColumn
Indirect known subclasses
X2LeadsDataColumnCopyright: 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/CDataColumn.php
public
|
|
public
string
|
#
getFilterCellContent( )
Returns the filter cell content. This method will return the |
public
string
|
#
getHeaderCellContent( )
Returns the header cell content. This method will render a link that can trigger the sorting if the column is sortable. |
public
string
|
#
getDataCellContent( integer $row )
Returns the data cell content. This method evaluates |
__construct(),
getFooterCellContent(),
getHasFooter(),
renderDataCell(),
renderFilterCell(),
renderFooterCell(),
renderHeaderCell()
|
public
string
|
$name |
|
#
the attribute name of the data model. Used for column sorting, filtering and
to render the corresponding attribute value in each data cell. If |
public
string
|
$value |
|
#
a PHP expression that will be evaluated for every data cell using
CComponent::evaluateExpression() and whose result will be rendered as the content of the data
cell. In this expression, you can use the following variables:
|
public
string
|
$type | 'text' |
#
the type of the attribute value. This determines how the attribute value is
formatted for display. Valid values include those recognizable by CGridView::formatter, such as: raw, text, ntext, html, date, time, datetime,
boolean, number, email, image, url. For more details, please refer to |
public
boolean
|
$sortable | true |
#
whether the column is sortable. If so, the header cell will contain a link
that may trigger the sorting. Defaults to true. Note that if |
public
mixed
|
$filter |
|
#
the HTML code representing a filter input (eg a text field, a dropdown list)
that is used for this data column. This property is effective only when |
$cssClassExpression,
$filterHtmlOptions,
$footer,
$footerHtmlOptions,
$grid,
$header,
$headerHtmlOptions,
$htmlOptions,
$id,
$visible
|
$filterCellContent,
$footerCellContent,
$hasFooter,
$headerCellContent
|