Cgridview Dropdownlist

hi

I have a view which uses the cgridview,

In this grid I want to display the day of the week, and subsequently allow the user to modify it as well. Hence I am using the dropdownlist. The actual data is stored as two letter prefix in the database, so I need to map the value from db to the actual day.

My code for the grid is mentioned below, pls see if I am missing something here:




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

		'dataProvider'=>$dataProvider,

		'columns'=>array(

			'recurrence',

			array(

			'type'=>'raw',

				'name'=>'day',

				'value'=>'$data->day',

				'filter'=> ' CHtml::dropDownList(\'someName\'.$row,\'$data->day\',array(

                    \'Mo\'=>\'Monday\',

                    \'Tu\'=>\'Tuesday\',

                    \'We\'=>\'Wednesday\',

                    \'Th\'=>\'Thursday\',

                    \'Fr\'=>\'Friday\',

                    \'Sa\'=>\'Saturday\',

                    \'Su\'=>\'Sunday\',))',  


                ),

			'ts_id'

		)

	)); 



Thanks

Hi, the filter is an array.

Here an example of CgridView declaration in my project:




		array(

			'header'=>'Groupe',

			'name'=>'group_search',

            'filter' => array('lié à un groupe' => 'lié à un groupe', 'non lié à un groupe' => 'non lié à un groupe', CHtml::listData(Groups::model()->findAll(array('condition'=>'group_id > 0 and semester_id =' .Yii::app()->user->getState('defaultSemester'))), 'group_id', 'group_name')),



Hope it will help.

Hi

if u are fetch the data form table


array(

			'name'=>'liquor_category_id',

			'value'=>'GxHtml::valueEx($data->LiquorCategory)',

			'filter'=>GxHtml::listDataEx(LiquorCategory::model()->findAllAttributes(null, true)),

			),