我收到错误
Uncaught TypeError: undefined is not a function jquery.yiigridview.js
我尝试了几种方法,但我认为我没有正确执行此操作。我目前有:
$this->widget ( 'bootstrap.widgets.TbGridView', array (
'type' => 'condensed',
'id'=>'inq',
'dataProvider' => $dataProvider,
'template' => '{items}{pager}',
'columns' => array (
array(
'header'=>'',
'type'=>'raw',
'htmlOptions'=>array('style'=>'width:30px'),
'value'=>function($data,$row){
if($data->message_target_read == "Read")
return CHtml::ajaxLink('<img src="'.Yii::app()->baseUrl.'/images/site/star-read.png">',
Yii::app()->createUrl("controller/action", array("id"=>$data->id)),
array("complete"=>"function(){
$.fn.yiiGridView.update('inq', {
type: 'POST',
url: $(this).attr('href'),
success: function() {
$.fn.yiiGridView.update('inq');}
});return false;}"));
我也尝试过chtml::link
使用一个类并获取Yii::app()->clientScript->registerCoreScript('class'
,但它一直在重定向整个页面。我也试过这样做
CHtml::ajaxLink("<img>",Yii::app()->createUrl("controller/action", array("id"=>$data->id)),array(
type: 'POST',
url: $(this).attr('href'),
success: function() {
$.fn.yiiGridView.update('inq');
}