使用 ajax 进行删除,但显示为 (1-25 of 100 ) 的计数摘要必须更新为 (1-25 of 99)。怎么做?
更新了代码:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$provider,
'filter' => $model,
'hideHeader'=>false,
'afterAjaxUpdate'=>'function(id,data){jQuery("#summaryUpdate").html(" - " +jQuery(".grid-view .summary").html());}',
'columns'=>array(
'id',
'username',
'dob',
'email',
array(
'class'=>'CCustomColumn',
'afterDelete' => 'function(id,data){jQuery("#summaryUpdate").html(" - " +jQuery(".grid-view .summary").html());}',
'updateButtonImageUrl'=>Yii::app()->baseUrl.'/images/edit.png',
'deleteButtonImageUrl'=>Yii::app()->baseUrl.'/images/delete.png',
'buttons'=>array(
'update'=>array('url'=>'Yii::app()->createUrl("user/update", array("id"=>$data["id"]))', ),
'delete'=>array('url'=>'Yii::app()->createUrl("user/delete", array("id"=>$data["id"]))', )
)
),
),
'cssFile'=>Yii::app()->request->baseUrl."/css/gridview.css",
));