PHP Класс WhToggleColumn

Автор: Antonio Ramirez ([email protected])
Наследование: extends TbDataColumn
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$afterToggle a javascript function that will be invoked after the toggle ajax call. The function signature is function(data)
  • success status of the ajax call, true if the ajax call was successful, false if the ajax call failed.
  • data the data returned by the server in case of a successful call or XHR object in case of error.
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:
 array(
    class'=>'TbToggleColumn',
    'afterToggle'=>'function(success,data){ if (success) alert("Toggled successfuly"); }',
 ),
$checkedButtonLabel the label for the toggle button. Defaults to "Check". Note that the label will not be HTML-encoded when rendering.
$checkedIcon the glyph icon toggle button "checked" state. You may set this property to be false to render a text link instead.
$displayText display button with text or only icon with label tooltip
$emptyButtonLabel the label for the NULL value toggle button. Defaults to "Not Set". Note that the label will not be HTML-encoded when rendering.
$emptyIcon the glyph icon toggle button "empty" state (example for null value)
$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 {@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.
$footerHtmlOptions the HTML options for the footer cell tag.
$headerHtmlOptions the HTML options for the header cell tag.
$htmlOptions the HTML options for the data cell tags.
$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 {@link value} is specified it will be used to rendered the data cell instead of the attribute value.
$sortable 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.
$toggleAction Name of the action to call and toggle values
$uncheckedButtonLabel the label for the toggle button. Defaults to "Uncheck". Note that the label will not be HTML-encoded when rendering.
$uncheckedIcon the glyph icon toggle button "unchecked" state. You may set this property to be false to render a text link instead.
$uniqueClassSuffix suffix substituted to a name class of the tag

Защищенные свойства (Protected)

Свойство Тип Описание
$toggleOptions the configuration for toggle button.

Открытые методы

Метод Описание
init ( ) Initializes the column.

Защищенные методы

Метод Описание
initButton ( ) Initializes the default buttons (toggle).
registerClientScript ( ) Registers the client scripts for the button column.
renderDataCellContent ( integer $row, mixed $data ) Renders the data cell content.

Приватные методы

Метод Описание
getButtonLabel ( $value ) : string Returns the button label

Описание методов

init() публичный Метод

This method registers necessary client script for the button column.
public init ( )

initButton() защищенный Метод

Initializes the default buttons (toggle).
protected initButton ( )

registerClientScript() защищенный Метод

Registers the client scripts for the button column.
protected registerClientScript ( )

renderDataCellContent() защищенный Метод

This method renders the view, update and toggle buttons in the data cell.
protected renderDataCellContent ( integer $row, mixed $data )
$row integer the row number (zero-based)
$data mixed the data associated with the row

Описание свойств

$afterToggle публичное свойство

a javascript function that will be invoked after the toggle ajax call. The function signature is function(data)
  • success status of the ajax call, true if the ajax call was successful, false if the ajax call failed.
  • data the data returned by the server in case of a successful call or XHR object in case of error.
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:
 array(
    class'=>'TbToggleColumn',
    'afterToggle'=>'function(success,data){ if (success) alert("Toggled successfuly"); }',
 ),
public $afterToggle

$checkedButtonLabel публичное свойство

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

$checkedIcon публичное свойство

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

$displayText публичное свойство

display button with text or only icon with label tooltip
public $displayText

$emptyButtonLabel публичное свойство

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

$emptyIcon публичное свойство

the glyph icon toggle button "empty" state (example for null value)
public $emptyIcon

$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 {@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.
С версии: 1.1.1
public $filter

$footerHtmlOptions публичное свойство

the HTML options for the footer cell tag.
public $footerHtmlOptions

$headerHtmlOptions публичное свойство

the HTML options for the header cell tag.
public $headerHtmlOptions

$htmlOptions публичное свойство

the HTML options for the data cell tags.
public $htmlOptions

$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 {@link value} is specified it will be used to rendered the data cell instead of the attribute value.
См. также: value
См. также: sortable
public $name

$sortable публичное свойство

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.
См. также: name
public $sortable

$toggleAction публичное свойство

Name of the action to call and toggle values
public $toggleAction

$toggleOptions защищенное свойство

the configuration for toggle button.
protected $toggleOptions

$uncheckedButtonLabel публичное свойство

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

$uncheckedIcon публичное свойство

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

$uniqueClassSuffix публичное свойство

suffix substituted to a name class of the tag
public $uniqueClassSuffix