More information about this topic
Reset database
GridView CSS Styling example
Yiiplayground is showing you 21 - 23 of 23 cool records
UsernameEmail(fake) Actions
test7test7@example.comView Update Delete
test8test8@example.comView Update Delete
test9test9@example.comView Update Delete


$this->widget('zii.widgets.grid.CGridView', array(
		'dataProvider' => $model->search(),
		'filter' => $model,
		//lets tell the pager to use our own css file
		'pager' => array('cssFile' => Yii::app()->baseUrl . '/css/gridViewStyle/gridView.css'),
		//the same for our entire grid. Note that this value can be set to "false"
		//if you set this to false, you'll have to include the styles for grid in some of your css files
		'cssFile' => Yii::app()->baseUrl . '/css/gridViewStyle/gridView.css',
		//changing the text above the grid can be fun
		'summaryText' => 'Yiiplayground is showing you {start} - {end} of {count} cool records',
		//and you can even set your own css class to the grid container
		'htmlOptions' => array('class' => 'grid-view rounded'),
		'columns' => array(
						'name' => 'username',
						'type' => 'raw',
						'value' => 'CHtml::encode($data->username)'
						'name' => 'email',
						'type' => 'raw',
						'value' => 'CHtml::link(CHtml::encode($data->email), "mailto:".CHtml::encode($data->email))',
				//styling default buttons
						'header' => '(fake) Actions',
						'class' => 'CButtonColumn',
						'viewButtonImageUrl' => Yii::app()->baseUrl . '/css/gridViewStyle/images/' . 'gr-view.png',
						'updateButtonImageUrl' => Yii::app()->baseUrl . '/css/gridViewStyle/images/' . 'gr-update.png',
						'deleteButtonImageUrl' => Yii::app()->baseUrl . '/css/gridViewStyle/images/' . 'gr-delete.png',
Fork me on GitHub