Свойство | Тип | Описание | |
---|---|---|---|
$afterAjaxUpdate | a javascript function that will be invoked if an AJAX call occurs.
The function signature is function(tr, rowid, data)
... '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 |
protected getPrimaryKey ( CActiveRecord $data ) : null | string | ||
$data | CActiveRecord | |
Результат | null | string |
public registerClientScript ( ) |
public renderDataCell ( integer $row ) | ||
$row | integer |
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.... 'afterAjaxUpdate'=>'js:function(tr,rowid, data){ console.log(rowid); }', ...
public $afterAjaxUpdate |
public string $ajaxErrorMessage | ||
Результат | string |
public bool $cacheData | ||
Результат | boolean |
public string $cssClass | ||
Результат | string |
public string $url | ||
Результат | string |