Cgridview counter column

4 0
8
Viewed: 13 898 times
Version: Unknown (update)
Category: Tips
Written by: Nisanth thulasi Nisanth thulasi
Updated by: trond trond
Created: Jul 26, 2013
Updated: 13 years ago

You are viewing revision #2 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version or see the changes made in this revision.

« previous (#1)next (#3) »

some times we want to show the serailNo 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)',
        ),
       ............
));