3

使用 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",
        ));
4

1 回答 1

2

它应该自动更新您使用的摘要

$.fn.yiiGridView.update('grid-name');

更新网格?

于 2013-01-03T22:05:20.270 回答