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 CGridColumn

CGridColumn is the base class for all grid view column classes.

A CGridColumn object represents the specification for rendering the cells in a particular grid view column.

In a column, there is one header cell, multiple data cells, and an optional footer cell. Child classes may override renderHeaderCellContent, renderDataCellContent and renderFooterCellContent to customize how these cells are rendered.

CComponent
Extended by CGridColumn

Direct known subclasses

CButtonColumn, CCheckBoxColumn, CDataColumn, CLinkColumn

Indirect known subclasses

EButtonColumnWithClearFilters, X2ButtonColumn, X2CheckBoxColumn, X2DataColumn, X2DataColumnGeneric, X2LeadsDataColumn
Abstract
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/CGridColumn.php
Methods summary
public
# __construct( CGridView $grid )

Constructor.

Constructor.

Parameters

$grid
CGridView
$grid the grid view that owns this column.
public
# init( )

Initializes the column. This method is invoked by the grid view when it initializes itself before rendering. You may override this method to prepare the column for rendering.

Initializes the column. This method is invoked by the grid view when it initializes itself before rendering. You may override this method to prepare the column for rendering.

public boolean
# getHasFooter( )

Returns

boolean
whether this column has a footer cell. This is determined based on whether CGridColumn::$footer is set.
public
# renderFilterCell( )

Renders the filter cell.

Renders the filter cell.

Since

1.1.1
public
# renderHeaderCell( )

Renders the header cell.

Renders the header cell.

public
# renderDataCell( integer $row )

Renders a data cell.

Renders a data cell.

Parameters

$row
integer
$row the row number (zero-based)
public
# renderFooterCell( )

Renders the footer cell.

Renders the footer cell.

public string
# getHeaderCellContent( )

Returns the header cell content. The default implementation simply returns CGridColumn::$header. This method may be overridden to customize the rendering of the header cell.

Returns the header cell content. The default implementation simply returns CGridColumn::$header. This method may be overridden to customize the rendering of the header cell.

Returns

string
the header cell content.

Since

1.1.16
public string
# getFooterCellContent( )

Returns the footer cell content. The default implementation simply returns CGridColumn::$footer. This method may be overridden to customize the rendering of the footer cell.

Returns the footer cell content. The default implementation simply returns CGridColumn::$footer. This method may be overridden to customize the rendering of the footer cell.

Returns

string
the footer cell content.

Since

1.1.16
public string
# getDataCellContent( integer $row )

Returns the data cell content. This method SHOULD be overridden to customize the rendering of the data cell.

Returns the data cell content. This method SHOULD be overridden to customize the rendering of the data cell.

Parameters

$row
integer
$row the row number (zero-based) The data for this row is available via <span class="php-var">$this</span>->grid->dataProvider->data[<span class="php-var">$row</span>];

Returns

string
the data cell content.

Since

1.1.16
public string
# getFilterCellContent( )

Returns the filter cell content. The default implementation simply returns an empty column. This method may be overridden to customize the rendering of the filter cell (if any).

Returns the filter cell content. The default implementation simply returns an empty column. This method may be overridden to customize the rendering of the filter cell (if any).

Returns

string
the filter cell content.

Since

1.1.16
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 $id
#

the ID of this column. This value should be unique among all grid view columns. If this is not set, it will be assigned one automatically.

the ID of this column. This value should be unique among all grid view columns. If this is not set, it will be assigned one automatically.

public CGridView $grid
#

the grid view object that owns this column.

the grid view object that owns this column.

public string $header
#

the header cell text. Note that it will not be HTML-encoded.

the header cell text. Note that it will not be HTML-encoded.

public string $footer
#

the footer cell text. Note that it will not be HTML-encoded.

the footer cell text. Note that it will not be HTML-encoded.

public boolean $visible true
#

whether this column is visible. Defaults to true.

whether this column is visible. Defaults to true.

public string $cssClassExpression
#
a PHP expression that is evaluated for every data cell and whose result is used as the CSS class name for 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
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 is evaluated for every data cell and whose result is used as the CSS class name for 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
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 array $htmlOptions array()
#

the HTML options for the data cell tags.

the HTML options for the data cell tags.

public array $filterHtmlOptions array()
#

the HTML options for the filter cell tag.

the HTML options for the filter cell tag.

public array $headerHtmlOptions array()
#

the HTML options for the header cell tag.

the HTML options for the header cell tag.

public array $footerHtmlOptions array()
#

the HTML options for the footer cell tag.

the HTML options for the footer cell tag.

Magic properties summary
public boolean $hasFooter
#

Whether this column has a footer cell. This is determined based on whether CGridColumn::$footer is set.

Whether this column has a footer cell. This is determined based on whether CGridColumn::$footer is set.

public string $filterCellContent
#

The filter cell content.

The filter cell content.

public string $headerCellContent
#

The header cell content.

The header cell content.

public string $footerCellContent
#

The footer cell content.

The footer cell content.

API documentation generated by ApiGen 2.8.0