Frage

Deletion is happening using ajax, but the count summary showing like (1-25 of 100 ) has to be updated as (1-25 of 99). how to do that?

UPDATED THE CODE:

$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",
        ));
War es hilfreich?

Lösung

it should update the summary automatically did you use

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

to update the grid ?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top