Index Column for CGridView

how can i add a column like that ?

additionally it would be perfect if i can show a spesific page with a spesific index number :)

are you using CGridView? if so then when initiating widget




$this->widget('zii.widgets.CGridView', array(

	'dataProvider'=>$dataProvider,


	// add columns manualy

	'columns'=>array(

		// add number

		array(

			'name'=>'Number',

			// an array of class and method wich will be called with call_user_func_array

			'value'=>array('MyClass', 'myMethod')

		),

		

		'username',

		'email'

	)

);


//the callback function 


class MyClass

{

	public static function myMethod($data, $row, $component)

	{

		//the $data is the ActiveRecord Model collection from the dataProvider

		//the $row is the data row

		//the $component is the CGridColumn object for each columns

		

		// return the result you want

	}

}