PHP 클래스 WhToggleColumn

저자: Antonio Ramirez ([email protected])
상속: extends TbDataColumn
파일 보기 프로젝트 열기: 2amigos/yiiwheels

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$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