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

Direct known subclasses

X2DataColumn, X2DataColumnGeneric

Indirect known subclasses

X2LeadsDataColumn
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/CDataColumn.php
Methods summary
public
# init( )

Initializes the column.

Initializes the column.

Overrides

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

Returns the filter cell content. This method will return the CDataColumn::$filter as is if it is a string. If CDataColumn::$filter is an array, it is assumed to be a list of options, and a dropdown selector will be rendered. Otherwise if CDataColumn::$filter is not false, a text field is rendered.

Returns the filter cell content. This method will return the CDataColumn::$filter as is if it is a string. If CDataColumn::$filter is an array, it is assumed to be a list of options, and a dropdown selector will be rendered. Otherwise if CDataColumn::$filter is not false, a text field is rendered.

Returns

string
the filter cell content

Since

1.1.16

Overrides

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

Returns the header cell content. This method will render a link that can trigger the sorting if the column is sortable.

Returns the header cell content. This method will render a link that can trigger the sorting if the column is sortable.

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 evaluates CDataColumn::$value or CDataColumn::$name and renders the result.

Returns the data cell content. This method evaluates CDataColumn::$value or CDataColumn::$name and renders the result.

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(), 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. Used for column sorting, filtering and to render the corresponding attribute value in each data cell. If CDataColumn::$value is specified it will be used to rendered the data cell instead of the attribute value.

the attribute name of the data model. Used for column sorting, filtering and to render the corresponding attribute value in each data cell. If CDataColumn::$value is specified it will be used to rendered the data cell instead of the attribute value.

See

CDataColumn::$value
CDataColumn::$sortable
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:
  • <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.
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 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:
  • <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.
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 $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 CFormatter. Defaults to 'text' which means the attribute value will be HTML-encoded.

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 CFormatter. Defaults to 'text' which means the attribute value will be HTML-encoded.

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 CDataColumn::$name is not set, or if CDataColumn::$name is not allowed by CSort, this property will be treated as false.

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 CDataColumn::$name is not set, or if CDataColumn::$name is not allowed by CSort, this property will be treated as false.

See

CDataColumn::$name
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 CGridView::$filter is set. If this property is not set, a text field will be generated as the filter input; If this property is an array, a dropdown list will be generated that uses this property value as the list options. If you don't want a filter for this data column, set this value to false.

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 CGridView::$filter is set. If this property is not set, a text field will be generated as the filter input; If this property is an array, a dropdown list will be generated that uses this property value as the list options. If you don't want a filter for this data column, set this value to false.

Since

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