PHP 클래스 WhRelationalColumn

Displays a clickable column that will make an ajax request and display its resulting data into a new row.
저자: Antonio Ramirez ([email protected])
상속: extends TbDataColumn
파일 보기 프로젝트 열기: 2amigos/yiiwheels

공개 프로퍼티들

프로퍼티 타입 설명
$afterAjaxUpdate a javascript function that will be invoked if an AJAX call occurs. The function signature is function(tr, rowid, data)
  • tr is the newly created TR HTML object that will display the returned server data.
  • rowid the model id of the row.
  • data is the data returned by the server that is already displayed on the row.
Note: This handler is not called for JSONP requests. Example (add in a call to TbRelationalColumn):
 ...
 'afterAjaxUpdate'=>'js:function(tr,rowid, data){ console.log(rowid); }',
 ...
$ajaxErrorMessage string the message that is displayed on the newly created row in case there is an AJAX error.
$cacheData boolean if set to true, there won't be more than one AJAX request. If set to false, the widget will continuously make AJAX requests. This is useful if the data could vary. If the data doesn't change then is better to set it to true. Defaults to true.
$cssClass string the class name that will wrap up the cell content. Important Note: this class will be used as the trigger for the AJAX call, so make sure is unique for the column.
$url string the route to call via AJAX to get the data from

공개 메소드들

메소드 설명
init ( ) widget initialization
registerClientScript ( ) Register script that will handle its behavior
renderDataCell ( integer $row ) Overrides CDataColumn renderDataCell in order to wrap up its content with the object that will be used as a trigger.

보호된 메소드들

메소드 설명
getPrimaryKey ( CActiveRecord $data ) : null | string Helper function to return the primary key of the $data * IMPORTANT: composite keys on CActiveDataProviders will return the keys joined by comma

메소드 상세

getPrimaryKey() 보호된 메소드

Helper function to return the primary key of the $data * IMPORTANT: composite keys on CActiveDataProviders will return the keys joined by comma
protected getPrimaryKey ( CActiveRecord $data ) : null | string
$data CActiveRecord
리턴 null | string

init() 공개 메소드

widget initialization
public init ( )

registerClientScript() 공개 메소드

Register script that will handle its behavior

renderDataCell() 공개 메소드

Important: Making use of links as a content for this of column is an error.
public renderDataCell ( integer $row )
$row integer

프로퍼티 상세

$afterAjaxUpdate 공개적으로 프로퍼티

a javascript function that will be invoked if an AJAX call occurs. The function signature is function(tr, rowid, data)
  • tr is the newly created TR HTML object that will display the returned server data.
  • rowid the model id of the row.
  • data is the data returned by the server that is already displayed on the row.
Note: This handler is not called for JSONP requests. Example (add in a call to TbRelationalColumn):
 ...
 'afterAjaxUpdate'=>'js:function(tr,rowid, data){ console.log(rowid); }',
 ...
public $afterAjaxUpdate

$ajaxErrorMessage 공개적으로 프로퍼티

the message that is displayed on the newly created row in case there is an AJAX error.
public string $ajaxErrorMessage
리턴 string

$cacheData 공개적으로 프로퍼티

if set to true, there won't be more than one AJAX request. If set to false, the widget will continuously make AJAX requests. This is useful if the data could vary. If the data doesn't change then is better to set it to true. Defaults to true.
public bool $cacheData
리턴 boolean

$cssClass 공개적으로 프로퍼티

the class name that will wrap up the cell content. Important Note: this class will be used as the trigger for the AJAX call, so make sure is unique for the column.
public string $cssClass
리턴 string

$url 공개적으로 프로퍼티

the route to call via AJAX to get the data from
public string $url
리턴 string