Cgridview counter column

This wiki article has not been tagged with a corresponding Yii version yet.
Help us improve the wiki by updating the version information.

some times we want to show the serialNo on cgridview .

$this->widget('zii.widgets.grid.CGridView', array(
  
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'columns'=>array(
        array(
            'header'=>'Sr #',
            'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
        ),
       ............
));
4 0
8 followers
Viewed: 11 146 times
Version: Unknown (update)
Category: Tips
Written by: Nisanth thulasi
Last updated by: trond
Created on: Jul 26, 2013
Last updated: 11 years ago
Update Article

Revisions

View all history