Properties

$value

$value

$name

$name : string

Type

string — the attribute name of the data model. Used for column sorting, filtering and to render the corresponding attribute value in each data cell. If {@link value} is specified it will be used to rendered the data cell instead of the attribute value.

$htmlOptions

$htmlOptions : array

Type

array — the HTML options for the data cell tags.

$headerHtmlOptions

$headerHtmlOptions : array

Type

array — the HTML options for the header cell tag.

$footerHtmlOptions

$footerHtmlOptions : array

Type

array — the HTML options for the footer cell tag.

$checkedButtonLabel

$checkedButtonLabel : string

Type

string — the label for the toggle button. Defaults to "Check". Note that the label will not be HTML-encoded when rendering.

$uncheckedButtonLabel

$uncheckedButtonLabel : string

Type

string — the label for the toggle button. Defaults to "Uncheck". Note that the label will not be HTML-encoded when rendering.

$emptyButtonLabel

$emptyButtonLabel : string

Type

string — the label for the NULL value toggle button. Defaults to "Not Set". Note that the label will not be HTML-encoded when rendering.

$checkedIcon

$checkedIcon : string

Type

string — the glyph icon toggle button "checked" state. You may set this property to be false to render a text link instead.

$uncheckedIcon

$uncheckedIcon : string

Type

string — the glyph icon toggle button "unchecked" state. You may set this property to be false to render a text link instead.

$emptyIcon

$emptyIcon : string

Type

string — the glyph icon toggle button "empty" state (example for null value)

$displayText

$displayText : boolean

Type

boolean — display button with text or only icon with label tooltip

$sortable

$sortable : boolean

Type

boolean — 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 {@link name} is not set, or if {@link name} is not allowed by {@link CSort}, this property will be treated as false.

$filter

$filter : mixed

Type

mixed — 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 {@link 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.

$toggleAction

$toggleAction : string

Type

string — Name of the action to call and toggle values

$afterToggle

$afterToggle : string

Type

string — a javascript function that will be invoked after the toggle ajax call. The function signature is <code>function(data)</code> <ul> <li><code>success</code> status of the ajax call, true if the ajax call was successful, false if the ajax call failed. <li><code>data</code> the data returned by the server in case of a successful call or XHR object in case of error. </ul> Note that if success is true it does not mean that the delete was successful, it only means that the ajax call was successful. Example: <pre> array( class'=>'TbToggleColumn', 'afterToggle'=>'function(success,data){ if (success) alert("Toggled successfuly"); }', ), </pre>

$uniqueClassSuffix

$uniqueClassSuffix : string

Type

string — suffix substituted to a name class of the tag <a>

$filterInputOptions

$filterInputOptions : array

Type

array — HTML options for filter input

$grid

$grid : \TbGridView|\TbExtendedGridView

the grid view object that owns this column.

Type

\TbGridView|\TbExtendedGridView

$button

$button : array

Type

array — the configuration for toggle button.

Methods

init()

init()

Initializes the column.

This method registers necessary client script for the button column.

renderFilterCell()

renderFilterCell()

### .renderFilterCell()

Renders the filter cell.

renderDataCell()

renderDataCell(integer $row) : array|void

Renders the data cell content.

This method renders the view, update and toggle buttons in the data cell.

Parameters

integer $row

the row number (zero-based)

Returns

array|void

initButton()

initButton()

Initializes the default toggle button.

registerClientScript()

registerClientScript()

Registers the client scripts for the button column.

renderDataCellContent()

renderDataCellContent(integer $row, mixed $data)

Renders the data cell content.

This method renders the view, update and toggle buttons in the data cell.

Parameters

integer $row

the row number (zero-based)

mixed $data

the data associated with the row

renderHeaderCellContent()

renderHeaderCellContent()

### .renderHeaderCellContent()

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

renderFilterCellContent()

renderFilterCellContent()

### .renderFilterCellContent()

Renders the filter cell content. On top of Yii's default, here we can provide HTML options for actual filter input

getButtonLabel()

getButtonLabel( $value)

Parameters

$value